Skip to content

Commit a6107e2

Browse files
rebase: mention --abort alongside --continue
The warning shown when an "exec" step fails and the "git status" advice while splitting or editing a commit pointed users at "git rebase --continue" but not "--abort". Mention it in both, matching the conflict case. Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
1 parent ea97ad8 commit a6107e2

3 files changed

Lines changed: 29 additions & 3 deletions

File tree

sequencer.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3884,7 +3884,9 @@ static int do_exec(struct repository *r, const char *command_line, int quiet)
38843884
"You can fix the problem, and then run\n"
38853885
"\n"
38863886
" git rebase --continue\n"
3887-
"\n"),
3887+
"\n"
3888+
"To abort and get back to the state before \"git rebase\", run "
3889+
"\"git rebase --abort\".\n"),
38883890
command_line,
38893891
dirty ? _("and made changes to the index and/or the "
38903892
"working tree.\n") : "");
@@ -3897,7 +3899,9 @@ static int do_exec(struct repository *r, const char *command_line, int quiet)
38973899
"Commit or stash your changes, and then run\n"
38983900
"\n"
38993901
" git rebase --continue\n"
3900-
"\n"), command_line);
3902+
"\n"
3903+
"To abort and get back to the state before \"git rebase\", run "
3904+
"\"git rebase --abort\".\n"), command_line);
39013905
status = 1;
39023906
}
39033907

t/t7512-status-help.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ No commands remaining.
206206
You are currently editing a commit while rebasing branch '\''rebase_i_edit'\'' on '\''$ONTO'\''.
207207
(use "git commit --amend" to amend the current commit)
208208
(use "git rebase --continue" once you are satisfied with your changes)
209+
(use "git rebase --abort" to check out the original branch)
209210
210211
nothing to commit (use -u to show untracked files)
211212
EOF
@@ -240,6 +241,7 @@ Next command to do (1 remaining command):
240241
(use "git rebase --edit-todo" to view and edit)
241242
You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
242243
(Once your working directory is clean, run "git rebase --continue")
244+
(use "git rebase --abort" to check out the original branch)
243245
244246
Changes not staged for commit:
245247
(use "git add <file>..." to update what will be committed)
@@ -278,6 +280,7 @@ No commands remaining.
278280
You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
279281
(use "git commit --amend" to amend the current commit)
280282
(use "git rebase --continue" once you are satisfied with your changes)
283+
(use "git rebase --abort" to check out the original branch)
281284
282285
nothing to commit (use -u to show untracked files)
283286
EOF
@@ -317,6 +320,7 @@ Next command to do (1 remaining command):
317320
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
318321
(use "git commit --amend" to amend the current commit)
319322
(use "git rebase --continue" once you are satisfied with your changes)
323+
(use "git rebase --abort" to check out the original branch)
320324
321325
nothing to commit (use -u to show untracked files)
322326
EOF
@@ -347,6 +351,7 @@ Next command to do (1 remaining command):
347351
(use "git rebase --edit-todo" to view and edit)
348352
You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
349353
(Once your working directory is clean, run "git rebase --continue")
354+
(use "git rebase --abort" to check out the original branch)
350355
351356
Changes not staged for commit:
352357
(use "git add <file>..." to update what will be committed)
@@ -383,6 +388,7 @@ Next command to do (1 remaining command):
383388
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
384389
(use "git commit --amend" to amend the current commit)
385390
(use "git rebase --continue" once you are satisfied with your changes)
391+
(use "git rebase --abort" to check out the original branch)
386392
387393
nothing to commit (use -u to show untracked files)
388394
EOF
@@ -414,6 +420,7 @@ Next command to do (1 remaining command):
414420
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
415421
(use "git commit --amend" to amend the current commit)
416422
(use "git rebase --continue" once you are satisfied with your changes)
423+
(use "git rebase --abort" to check out the original branch)
417424
418425
nothing to commit (use -u to show untracked files)
419426
EOF
@@ -445,6 +452,7 @@ Next command to do (1 remaining command):
445452
(use "git rebase --edit-todo" to view and edit)
446453
You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
447454
(Once your working directory is clean, run "git rebase --continue")
455+
(use "git rebase --abort" to check out the original branch)
448456
449457
Changes not staged for commit:
450458
(use "git add <file>..." to update what will be committed)
@@ -482,6 +490,7 @@ Next command to do (1 remaining command):
482490
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
483491
(use "git commit --amend" to amend the current commit)
484492
(use "git rebase --continue" once you are satisfied with your changes)
493+
(use "git rebase --abort" to check out the original branch)
485494
486495
nothing to commit (use -u to show untracked files)
487496
EOF
@@ -515,6 +524,7 @@ Next command to do (1 remaining command):
515524
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
516525
(use "git commit --amend" to amend the current commit)
517526
(use "git rebase --continue" once you are satisfied with your changes)
527+
(use "git rebase --abort" to check out the original branch)
518528
519529
nothing to commit (use -u to show untracked files)
520530
EOF
@@ -548,6 +558,7 @@ Next command to do (1 remaining command):
548558
(use "git rebase --edit-todo" to view and edit)
549559
You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
550560
(Once your working directory is clean, run "git rebase --continue")
561+
(use "git rebase --abort" to check out the original branch)
551562
552563
Changes not staged for commit:
553564
(use "git add <file>..." to update what will be committed)
@@ -587,6 +598,7 @@ Next command to do (1 remaining command):
587598
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
588599
(use "git commit --amend" to amend the current commit)
589600
(use "git rebase --continue" once you are satisfied with your changes)
601+
(use "git rebase --abort" to check out the original branch)
590602
591603
nothing to commit (use -u to show untracked files)
592604
EOF
@@ -718,6 +730,7 @@ No commands remaining.
718730
You are currently editing a commit while rebasing branch '\''bisect'\'' on '\''$ONTO'\''.
719731
(use "git commit --amend" to amend the current commit)
720732
(use "git rebase --continue" once you are satisfied with your changes)
733+
(use "git rebase --abort" to check out the original branch)
721734
722735
You are currently bisecting, started from branch '\''bisect_while_rebasing'\''.
723736
(use "git bisect reset" to get back to the original branch)
@@ -987,6 +1000,7 @@ No commands remaining.
9871000
You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
9881001
(use "git commit --amend" to amend the current commit)
9891002
(use "git rebase --continue" once you are satisfied with your changes)
1003+
(use "git rebase --abort" to check out the original branch)
9901004
9911005
nothing to commit (use -u to show untracked files)
9921006
EOF
@@ -1015,6 +1029,7 @@ Next commands to do (2 remaining commands):
10151029
You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
10161030
(use "git commit --amend" to amend the current commit)
10171031
(use "git rebase --continue" once you are satisfied with your changes)
1032+
(use "git rebase --abort" to check out the original branch)
10181033
10191034
nothing to commit (use -u to show untracked files)
10201035
EOF
@@ -1044,6 +1059,7 @@ Next commands to do (2 remaining commands):
10441059
You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
10451060
(use "git commit --amend" to amend the current commit)
10461061
(use "git rebase --continue" once you are satisfied with your changes)
1062+
(use "git rebase --abort" to check out the original branch)
10471063
10481064
nothing to commit (use -u to show untracked files)
10491065
EOF
@@ -1064,6 +1080,7 @@ Next command to do (1 remaining command):
10641080
You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
10651081
(use "git commit --amend" to amend the current commit)
10661082
(use "git rebase --continue" once you are satisfied with your changes)
1083+
(use "git rebase --abort" to check out the original branch)
10671084
10681085
nothing to commit (use -u to show untracked files)
10691086
EOF

wt-status.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1527,9 +1527,12 @@ static void show_rebase_in_progress(struct wt_status *s,
15271527
else
15281528
status_printf_ln(s, color,
15291529
_("You are currently splitting a commit during a rebase."));
1530-
if (s->hints)
1530+
if (s->hints) {
15311531
status_printf_ln(s, color,
15321532
_(" (Once your working directory is clean, run \"git rebase --continue\")"));
1533+
status_printf_ln(s, color,
1534+
_(" (use \"git rebase --abort\" to check out the original branch)"));
1535+
}
15331536
} else {
15341537
if (s->state.branch)
15351538
status_printf_ln(s, color,
@@ -1544,6 +1547,8 @@ static void show_rebase_in_progress(struct wt_status *s,
15441547
_(" (use \"git commit --amend\" to amend the current commit)"));
15451548
status_printf_ln(s, color,
15461549
_(" (use \"git rebase --continue\" once you are satisfied with your changes)"));
1550+
status_printf_ln(s, color,
1551+
_(" (use \"git rebase --abort\" to check out the original branch)"));
15471552
}
15481553
}
15491554
wt_longstatus_print_trailer(s);

0 commit comments

Comments
 (0)