author | Junio C Hamano <gitster@pobox.com> | |
Sun, 19 Oct 2008 23:06:31 +0000 (16:06 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 19 Oct 2008 23:06:31 +0000 (16:06 -0700) |
* ae/preservemerge:
rebase: Support preserving merges in non-interactive mode
rebase: Support preserving merges in non-interactive mode
1 | 2 | |||
---|---|---|---|---|
Documentation/git-rebase.txt | patch | | diff1 | | diff2 | | blob | history |
git-rebase.sh | patch | | diff1 | | diff2 | | blob | history |
diff --cc Documentation/git-rebase.txt
Simple merge
diff --cc git-rebase.sh
index f2742aa054d2080a4a554ade3916c3bfa110af67,03e5f95051382fb1a9b811e9974cb5424fee883b..023a6dc94a48f7abf2801359ad68d40909e9b6aa
--- 1/git-rebase.sh
--- 2/git-rebase.sh
+++ b/git-rebase.sh
}
is_interactive () {
- test -f "$dotest"/interactive ||
- while :; do case $#,"$1" in 0,|*,-i|*,--interactive) break ;; esac
+ while test $# != 0
+ do
+ case "$1" in
+ -i|--interactive)
+ interactive_rebase=explicit
+ break
+ ;;
+ -p|--preserve-merges)
+ interactive_rebase=implied
+ ;;
+ esac
shift
- done && test -n "$1"
+ done
+
+ if [ "$interactive_rebase" = implied ]; then
+ GIT_EDITOR=:
+ export GIT_EDITOR
+ fi
+
+ test -n "$interactive_rebase" || test -f "$dotest"/interactive
}
+run_pre_rebase_hook () {
+ if test -z "$OK_TO_SKIP_PRE_REBASE" &&
+ test -x "$GIT_DIR/hooks/pre-rebase"
+ then
+ "$GIT_DIR/hooks/pre-rebase" ${1+"$@"} || {
+ echo >&2 "The pre-rebase hook refused to rebase."
+ exit 1
+ }
+ fi
+}
+
test -f "$GIT_DIR"/rebase-apply/applying &&
die 'It looks like git-am is in progress. Cannot rebase.'