From: Johannes Schindelin Date: Sun, 8 Jul 2007 02:02:47 +0000 (+0100) Subject: rebase -i: remember the settings of -v, -s and -p when interrupted X-Git-Tag: v1.5.3-rc1~41 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8e4a91b;p=git.git rebase -i: remember the settings of -v, -s and -p when interrupted After interruption, be that an edit, or a conflicting commit, reset the variables VERBOSE, STRATEGY and PRESERVE_MERGES, so that the user does not have to respecify them with "rebase --continue". Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 1a064af38..ac4d559f0 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -23,6 +23,9 @@ REWRITTEN="$DOTEST"/rewritten PRESERVE_MERGES= STRATEGY= VERBOSE= +test -d "$REWRITTEN" && PRESERVE_MERGES=t +test -f "$DOTEST"/strategy && STRATEGY="$(cat "$DOTEST"/strategy)" +test -f "$DOTEST"/verbose && VERBOSE=t warn () { echo "$*" >&2 @@ -366,6 +369,7 @@ do echo $HEAD > "$DOTEST"/head echo $UPSTREAM > "$DOTEST"/upstream echo $ONTO > "$DOTEST"/onto + test -z "$STRATEGY" || echo "$STRATEGY" > "$DOTEST"/strategy test t = "$VERBOSE" && : > "$DOTEST"/verbose if [ t = "$PRESERVE_MERGES" ] then diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index c25133699..43a6675ca 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -202,4 +202,14 @@ test_expect_success '--continue tries to commit' ' git show HEAD | grep chouette ' +test_expect_success 'verbose flag is heeded, even after --continue' ' + git reset --hard HEAD@{1} && + test_tick && + ! git rebase -v -i --onto new-branch1 HEAD^ && + echo resolved > file1 && + git add file1 && + git rebase --continue > output && + grep "^ file1 | 2 +-$" output +' + test_done