224
COMMIT3=$(git rev-parse --short split_commit) &&
225
test_commit four_split main.txt four &&
226
COMMIT4=$(git rev-parse --short split_commit) &&
227
- FAKE_LINES="1 edit 2 3" &&
227
+ FAKE_LINES="reword 1 edit 2 fixup_-C 3" &&
228
export FAKE_LINES &&
229
test_when_finished "git rebase --abort" &&
230
ONTO=$(git rev-parse --short HEAD~3) &&
233
cat >expected <<EOF &&
234
interactive rebase in progress; onto $ONTO
235
Last commands done (2 commands done):
236
- pick $COMMIT2 # two_split
236
+ reword $COMMIT2 # two_split
237
edit $COMMIT3 # three_split
238
Next command to do (1 remaining command):
239
- pick $COMMIT4 # four_split
239
+ fixup -C $COMMIT4 # four_split
240
(use "git rebase --edit-todo" to view and edit)
241
You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
242
(Once your working directory is clean, run "git rebase --continue")
297
298
299
test_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" &&
301
export FAKE_LINES &&
302
test_when_finished "git rebase --abort" &&
303
COMMIT2=$(git rev-parse --short several_edits^^) &&
312
edit $COMMIT2 # two_edits
313
edit $COMMIT3 # three_edits
314
Next command to do (1 remaining command):
315
- pick $COMMIT4 # four_edits
315
+ drop $COMMIT4 # four_edits
316
(use "git rebase --edit-todo" to view and edit)
317
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
318
(use "git commit --amend" to amend the current commit)
327
328
test_expect_success 'status: (continue first edit) second edit and split' '
329
git reset --hard several_edits &&
330
- FAKE_LINES="edit 1 edit 2 3" &&
330
+ FAKE_LINES="edit 1 edit 2 squash 3" &&
331
export FAKE_LINES &&
332
test_when_finished "git rebase --abort" &&
333
COMMIT2=$(git rev-parse --short several_edits^^) &&
343
edit $COMMIT2 # two_edits
344
edit $COMMIT3 # three_edits
345
Next command to do (1 remaining command):
346
- pick $COMMIT4 # four_edits
346
+ squash $COMMIT4 # four_edits
347
(use "git rebase --edit-todo" to view and edit)
348
You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
349
(Once your working directory is clean, run "git rebase --continue")
362
363
test_expect_success 'status: (continue first edit) second edit and amend' '
364
git reset --hard several_edits &&
365
- FAKE_LINES="edit 1 edit 2 3" &&
365
+ FAKE_LINES="edit 1 edit 2 fixup 3" &&
366
export FAKE_LINES &&
367
test_when_finished "git rebase --abort" &&
368
COMMIT2=$(git rev-parse --short several_edits^^) &&
378
edit $COMMIT2 # two_edits
379
edit $COMMIT3 # three_edits
380
Next command to do (1 remaining command):
381
- pick $COMMIT4 # four_edits
381
+ fixup $COMMIT4 # four_edits
382
(use "git rebase --edit-todo" to view and edit)
383
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
384
(use "git commit --amend" to amend the current commit)
393
394
test_expect_success 'status: (amend first edit) second edit' '
395
git reset --hard several_edits &&
396
- FAKE_LINES="edit 1 edit 2 3" &&
396
+ FAKE_LINES="edit 1 edit 2 fixup_-c 3" &&
397
export FAKE_LINES &&
398
test_when_finished "git rebase --abort" &&
399
COMMIT2=$(git rev-parse --short several_edits^^) &&
409
edit $COMMIT2 # two_edits
410
edit $COMMIT3 # three_edits
411
Next command to do (1 remaining command):
412
- pick $COMMIT4 # four_edits
412
+ fixup -c $COMMIT4 # four_edits
413
(use "git rebase --edit-todo" to view and edit)
414
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
415
(use "git commit --amend" to amend the current commit)
460
461
test_expect_success 'status: (amend first edit) second edit and amend' '
462
git reset --hard several_edits &&
463
- FAKE_LINES="edit 1 edit 2 3" &&
464
- export FAKE_LINES &&
463
test_when_finished "git rebase --abort" &&
464
COMMIT2=$(git rev-parse --short several_edits^^) &&
465
COMMIT3=$(git rev-parse --short several_edits^) &&
466
COMMIT4=$(git rev-parse --short several_edits) &&
467
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
+ ) &&
477
git commit --amend -m "c" &&
478
git rebase --continue &&
479
git commit --amend -m "d" &&
483
edit $COMMIT2 # two_edits
484
edit $COMMIT3 # three_edits
485
Next command to do (1 remaining command):
480
- pick $COMMIT4 # four_edits
486
+ merge $(git rev-parse --short main) $COMMIT4
487
(use "git rebase --edit-todo" to view and edit)
488
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
489
(use "git commit --amend" to amend the current commit)
531
532
test_expect_success 'status: (split first edit) second edit and split' '
533
git reset --hard several_edits &&
528
- FAKE_LINES="edit 1 edit 2 3" &&
529
- export FAKE_LINES &&
534
test_when_finished "git rebase --abort" &&
535
COMMIT2=$(git rev-parse --short several_edits^^) &&
536
COMMIT3=$(git rev-parse --short several_edits^) &&
537
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
544
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
+ ) &&
549
git reset HEAD^ &&
550
git add main.txt &&
551
git commit --amend -m "f" &&
556
Last commands done (2 commands done):
557
edit $COMMIT2 # two_edits
558
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
562
(use "git rebase --edit-todo" to view and edit)
563
You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
564
(Once your working directory is clean, run "git rebase --continue")
577
578
test_expect_success 'status: (split first edit) second edit and amend' '
579
git reset --hard several_edits &&
566
- FAKE_LINES="edit 1 edit 2 3" &&
567
- export FAKE_LINES &&
580
test_when_finished "git rebase --abort" &&
581
+ git branch cafe main &&
582
COMMIT2=$(git rev-parse --short several_edits^^) &&
583
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
590
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
+ ) &&
595
git reset HEAD^ &&
596
git add main.txt &&
597
git commit --amend -m "g" &&
602
Last commands done (2 commands done):
603
edit $COMMIT2 # two_edits
604
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
608
(use "git rebase --edit-todo" to view and edit)
609
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
610
(use "git commit --amend" to amend the current commit)