From: Junio C Hamano Date: Sun, 19 Oct 2008 23:06:31 +0000 (-0700) Subject: Merge branch 'ae/preservemerge' X-Git-Tag: v1.6.1-rc1~133 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=edacb101ef831cdc59d07015b1b5cd1aaddcc588;p=git.git Merge branch 'ae/preservemerge' * ae/preservemerge: rebase: Support preserving merges in non-interactive mode --- edacb101ef831cdc59d07015b1b5cd1aaddcc588 diff --cc git-rebase.sh index f2742aa05,03e5f9505..023a6dc94 --- a/git-rebase.sh +++ b/git-rebase.sh @@@ -139,23 -138,28 +139,39 @@@ finish_rb_merge () } 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.'