Skip to content

Commit 8e4a91b

Browse files
dschogitster
authored andcommitted
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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3df0a85 commit 8e4a91b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

git-rebase--interactive.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ REWRITTEN="$DOTEST"/rewritten
2323
PRESERVE_MERGES=
2424
STRATEGY=
2525
VERBOSE=
26+
test -d "$REWRITTEN" && PRESERVE_MERGES=t
27+
test -f "$DOTEST"/strategy && STRATEGY="$(cat "$DOTEST"/strategy)"
28+
test -f "$DOTEST"/verbose && VERBOSE=t
2629

2730
warn () {
2831
echo "$*" >&2
@@ -366,6 +369,7 @@ do
366369
echo $HEAD > "$DOTEST"/head
367370
echo $UPSTREAM > "$DOTEST"/upstream
368371
echo $ONTO > "$DOTEST"/onto
372+
test -z "$STRATEGY" || echo "$STRATEGY" > "$DOTEST"/strategy
369373
test t = "$VERBOSE" && : > "$DOTEST"/verbose
370374
if [ t = "$PRESERVE_MERGES" ]
371375
then

t/t3404-rebase-interactive.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,14 @@ test_expect_success '--continue tries to commit' '
202202
git show HEAD | grep chouette
203203
'
204204

205+
test_expect_success 'verbose flag is heeded, even after --continue' '
206+
git reset --hard HEAD@{1} &&
207+
test_tick &&
208+
! git rebase -v -i --onto new-branch1 HEAD^ &&
209+
echo resolved > file1 &&
210+
git add file1 &&
211+
git rebase --continue > output &&
212+
grep "^ file1 | 2 +-$" output
213+
'
214+
205215
test_done

0 commit comments

Comments
 (0)