add configuration variable for --autosquash option of interactive rebase
[gitweb.git] / git-rebase--interactive.sh
index 436b7f5977c05c347debc12130f822af482c03e3..7b35f80818018a5b53f779541c27d85afd73dd00 100755 (executable)
@@ -111,6 +111,7 @@ VERBOSE=
 OK_TO_SKIP_PRE_REBASE=
 REBASE_ROOT=
 AUTOSQUASH=
+test "$(git config --bool rebase.autosquash)" = "true" && AUTOSQUASH=t
 NEVER_FF=
 
 GIT_CHERRY_PICK_HELP="  After resolving the conflicts,
@@ -795,6 +796,9 @@ first and then run 'git rebase --continue' again."
        --autosquash)
                AUTOSQUASH=t
                ;;
+       --no-autosquash)
+               AUTOSQUASH=
+               ;;
        --onto)
                shift
                ONTO=$(parse_onto "$1") ||
@@ -974,8 +978,9 @@ EOF
 
                test -d "$REWRITTEN" || test -n "$NEVER_FF" || skip_unnecessary_picks
 
+               output git checkout $ONTO || die_abort "could not detach HEAD"
                git update-ref ORIG_HEAD $HEAD
-               output git checkout $ONTO && do_rest
+               do_rest
                ;;
        esac
        shift