X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-rebase.sh;h=023a6dc94a48f7abf2801359ad68d40909e9b6aa;hb=6e13921b4f7adcc7316a76c0c4955b85b1589a65;hp=a30d40c0056dc32aa6123adc9856e649c469fcd0;hpb=01ed1079f3fae37eda7e0e0dcab9b74b34e9327e;p=git.git diff --git a/git-rebase.sh b/git-rebase.sh index a30d40c00..023a6dc94 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -34,6 +34,7 @@ set_reflog_action rebase require_work_tree cd_to_toplevel +OK_TO_SKIP_PRE_REBASE= RESOLVEMSG=" When you have resolved this problem run \"git rebase --continue\". If you would prefer to skip this patch, instead run \"git rebase --skip\". @@ -138,14 +139,31 @@ 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 -x "$GIT_DIR/hooks/pre-rebase" + 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." @@ -170,6 +188,9 @@ fi while test $# != 0 do case "$1" in + --no-verify) + OK_TO_SKIP_PRE_REBASE=yes + ;; --continue) test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply || die "No rebase in progress?"