@@ -224,7 +224,7 @@ test_expect_success 'status when splitting a commit' '
224224 COMMIT3=$(git rev-parse --short split_commit) &&
225225 test_commit four_split main.txt four &&
226226 COMMIT4=$(git rev-parse --short split_commit) &&
227- FAKE_LINES="1 edit 2 3" &&
227+ FAKE_LINES="reword 1 edit 2 fixup_-C 3" &&
228228 export FAKE_LINES &&
229229 test_when_finished "git rebase --abort" &&
230230 ONTO=$(git rev-parse --short HEAD~3) &&
@@ -233,10 +233,10 @@ test_expect_success 'status when splitting a commit' '
233233 cat >expected <<EOF &&
234234interactive rebase in progress; onto $ONTO
235235Last commands done (2 commands done):
236- pick $COMMIT2 # two_split
236+ reword $COMMIT2 # two_split
237237 edit $COMMIT3 # three_split
238238Next command to do (1 remaining command):
239- pick $COMMIT4 # four_split
239+ fixup -C $COMMIT4 # four_split
240240 (use "git rebase --edit-todo" to view and edit)
241241You are currently splitting a commit while rebasing branch ' \' ' split_commit' \' ' on ' \' ' $ONTO' \' ' .
242242 (Once your working directory is clean, run "git rebase --continue")
@@ -297,7 +297,7 @@ test_expect_success 'prepare for several edits' '
297297
298298
299299test_expect_success ' status: (continue first edit) second edit' '
300- FAKE_LINES="edit 1 edit 2 3" &&
300+ FAKE_LINES="edit 1 edit 2 drop 3" &&
301301 export FAKE_LINES &&
302302 test_when_finished "git rebase --abort" &&
303303 COMMIT2=$(git rev-parse --short several_edits^^) &&
@@ -312,7 +312,7 @@ Last commands done (2 commands done):
312312 edit $COMMIT2 # two_edits
313313 edit $COMMIT3 # three_edits
314314Next command to do (1 remaining command):
315- pick $COMMIT4 # four_edits
315+ drop $COMMIT4 # four_edits
316316 (use "git rebase --edit-todo" to view and edit)
317317You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
318318 (use "git commit --amend" to amend the current commit)
327327
328328test_expect_success ' status: (continue first edit) second edit and split' '
329329 git reset --hard several_edits &&
330- FAKE_LINES="edit 1 edit 2 3" &&
330+ FAKE_LINES="edit 1 edit 2 squash 3" &&
331331 export FAKE_LINES &&
332332 test_when_finished "git rebase --abort" &&
333333 COMMIT2=$(git rev-parse --short several_edits^^) &&
@@ -343,7 +343,7 @@ Last commands done (2 commands done):
343343 edit $COMMIT2 # two_edits
344344 edit $COMMIT3 # three_edits
345345Next command to do (1 remaining command):
346- pick $COMMIT4 # four_edits
346+ squash $COMMIT4 # four_edits
347347 (use "git rebase --edit-todo" to view and edit)
348348You are currently splitting a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
349349 (Once your working directory is clean, run "git rebase --continue")
362362
363363test_expect_success ' status: (continue first edit) second edit and amend' '
364364 git reset --hard several_edits &&
365- FAKE_LINES="edit 1 edit 2 3" &&
365+ FAKE_LINES="edit 1 edit 2 fixup 3" &&
366366 export FAKE_LINES &&
367367 test_when_finished "git rebase --abort" &&
368368 COMMIT2=$(git rev-parse --short several_edits^^) &&
@@ -378,7 +378,7 @@ Last commands done (2 commands done):
378378 edit $COMMIT2 # two_edits
379379 edit $COMMIT3 # three_edits
380380Next command to do (1 remaining command):
381- pick $COMMIT4 # four_edits
381+ fixup $COMMIT4 # four_edits
382382 (use "git rebase --edit-todo" to view and edit)
383383You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
384384 (use "git commit --amend" to amend the current commit)
393393
394394test_expect_success ' status: (amend first edit) second edit' '
395395 git reset --hard several_edits &&
396- FAKE_LINES="edit 1 edit 2 3" &&
396+ FAKE_LINES="edit 1 edit 2 fixup_-c 3" &&
397397 export FAKE_LINES &&
398398 test_when_finished "git rebase --abort" &&
399399 COMMIT2=$(git rev-parse --short several_edits^^) &&
@@ -409,7 +409,7 @@ Last commands done (2 commands done):
409409 edit $COMMIT2 # two_edits
410410 edit $COMMIT3 # three_edits
411411Next command to do (1 remaining command):
412- pick $COMMIT4 # four_edits
412+ fixup -c $COMMIT4 # four_edits
413413 (use "git rebase --edit-todo" to view and edit)
414414You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
415415 (use "git commit --amend" to amend the current commit)
@@ -460,14 +460,20 @@ EOF
460460
461461test_expect_success ' status: (amend first edit) second edit and amend' '
462462 git reset --hard several_edits &&
463- FAKE_LINES="edit 1 edit 2 3" &&
464- export FAKE_LINES &&
465463 test_when_finished "git rebase --abort" &&
466464 COMMIT2=$(git rev-parse --short several_edits^^) &&
467465 COMMIT3=$(git rev-parse --short several_edits^) &&
468466 COMMIT4=$(git rev-parse --short several_edits) &&
469467 ONTO=$(git rev-parse --short HEAD~3) &&
470- git rebase -i HEAD~3 &&
468+ cat >todo <<-EOF &&
469+ edit several_edits^^ # two_edits
470+ edit several_edits^ # three_edits
471+ merge $(git rev-parse main) $(git rev-parse several_edits)
472+ EOF
473+ (
474+ set_replace_editor todo &&
475+ git rebase -i HEAD~3
476+ ) &&
471477 git commit --amend -m "c" &&
472478 git rebase --continue &&
473479 git commit --amend -m "d" &&
@@ -477,7 +483,7 @@ Last commands done (2 commands done):
477483 edit $COMMIT2 # two_edits
478484 edit $COMMIT3 # three_edits
479485Next command to do (1 remaining command):
480- pick $COMMIT4 # four_edits
486+ merge $(git rev-parse --short main) $COMMIT4
481487 (use "git rebase --edit-todo" to view and edit)
482488You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
483489 (use "git commit --amend" to amend the current commit)
@@ -525,14 +531,21 @@ EOF
525531
526532test_expect_success ' status: (split first edit) second edit and split' '
527533 git reset --hard several_edits &&
528- FAKE_LINES="edit 1 edit 2 3" &&
529- export FAKE_LINES &&
530534 test_when_finished "git rebase --abort" &&
531535 COMMIT2=$(git rev-parse --short several_edits^^) &&
532536 COMMIT3=$(git rev-parse --short several_edits^) &&
533537 COMMIT4=$(git rev-parse --short several_edits) &&
538+ cat >todo <<-EOF &&
539+ edit several_edits^^ # two_edits
540+ edit several_edits^ # three_edits
541+ reset $(git rev-parse main)
542+ merge -C several_edits topic # title
543+ EOF
534544 ONTO=$(git rev-parse --short HEAD~3) &&
535- git rebase -i HEAD~3 &&
545+ (
546+ set_replace_editor todo &&
547+ git rebase -i HEAD~3
548+ ) &&
536549 git reset HEAD^ &&
537550 git add main.txt &&
538551 git commit --amend -m "f" &&
@@ -543,8 +556,9 @@ interactive rebase in progress; onto $ONTO
543556Last commands done (2 commands done):
544557 edit $COMMIT2 # two_edits
545558 edit $COMMIT3 # three_edits
546- Next command to do (1 remaining command):
547- pick $COMMIT4 # four_edits
559+ Next commands to do (2 remaining commands):
560+ reset $(git rev-parse --short main)
561+ merge -C $COMMIT4 topic # title
548562 (use "git rebase --edit-todo" to view and edit)
549563You are currently splitting a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
550564 (Once your working directory is clean, run "git rebase --continue")
@@ -563,14 +577,21 @@ EOF
563577
564578test_expect_success ' status: (split first edit) second edit and amend' '
565579 git reset --hard several_edits &&
566- FAKE_LINES="edit 1 edit 2 3" &&
567- export FAKE_LINES &&
568580 test_when_finished "git rebase --abort" &&
581+ git branch cafe main &&
569582 COMMIT2=$(git rev-parse --short several_edits^^) &&
570583 COMMIT3=$(git rev-parse --short several_edits^) &&
571- COMMIT4=$(git rev-parse --short several_edits) &&
584+ cat >todo <<-EOF &&
585+ edit several_edits^^ # two_edits
586+ edit several_edits^ # three_edits
587+ update-ref refs/heads/main
588+ reset cafe
589+ EOF
572590 ONTO=$(git rev-parse --short HEAD~3) &&
573- git rebase -i HEAD~3 &&
591+ (
592+ set_replace_editor todo &&
593+ git rebase -i HEAD~3
594+ ) &&
574595 git reset HEAD^ &&
575596 git add main.txt &&
576597 git commit --amend -m "g" &&
@@ -581,8 +602,9 @@ interactive rebase in progress; onto $ONTO
581602Last commands done (2 commands done):
582603 edit $COMMIT2 # two_edits
583604 edit $COMMIT3 # three_edits
584- Next command to do (1 remaining command):
585- pick $COMMIT4 # four_edits
605+ Next commands to do (2 remaining commands):
606+ update-ref refs/heads/main
607+ reset cafe
586608 (use "git rebase --edit-todo" to view and edit)
587609You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
588610 (use "git commit --amend" to amend the current commit)
0 commit comments