* [PATCH] rebase: mention --abort alongside --continue
@ 2026-06-15 19:19 Harald Nordgren via GitGitGadget
2026-06-16 8:36 ` Phillip Wood
0 siblings, 1 reply; 3+ messages in thread
From: Harald Nordgren via GitGitGadget @ 2026-06-15 19:19 UTC (permalink / raw)
To: git; +Cc: Harald Nordgren, Harald Nordgren
From: Harald Nordgren <haraldnordgren@gmail.com>
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>
---
rebase: mention --abort when an exec step fails
Mention git rebase --abort both in the warning shown when an exec step
fails and in the git status advice while splitting or editing a commit,
since rebase pointed users at --continue there without saying how to
bail out, unlike every comparable command.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2330%2FHaraldNordgren%2Frebase-exec-abort-hint-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2330/HaraldNordgren/rebase-exec-abort-hint-v1
Pull-Request: https://github.com/git/git/pull/2330
sequencer.c | 8 ++++++--
t/t7512-status-help.sh | 17 +++++++++++++++++
wt-status.c | 7 ++++++-
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 57855b0066..c46e5b95bc 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3884,7 +3884,9 @@ static int do_exec(struct repository *r, const char *command_line, int quiet)
"You can fix the problem, and then run\n"
"\n"
" git rebase --continue\n"
- "\n"),
+ "\n"
+ "To abort and get back to the state before \"git rebase\", run "
+ "\"git rebase --abort\".\n"),
command_line,
dirty ? _("and made changes to the index and/or the "
"working tree.\n") : "");
@@ -3897,7 +3899,9 @@ static int do_exec(struct repository *r, const char *command_line, int quiet)
"Commit or stash your changes, and then run\n"
"\n"
" git rebase --continue\n"
- "\n"), command_line);
+ "\n"
+ "To abort and get back to the state before \"git rebase\", run "
+ "\"git rebase --abort\".\n"), command_line);
status = 1;
}
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 08e82f7914..ca7ef66ae3 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -206,6 +206,7 @@ No commands remaining.
You are currently editing a commit while rebasing branch '\''rebase_i_edit'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
@@ -240,6 +241,7 @@ Next command to do (1 remaining command):
(use "git rebase --edit-todo" to view and edit)
You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
(Once your working directory is clean, run "git rebase --continue")
+ (use "git rebase --abort" to check out the original branch)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
@@ -278,6 +280,7 @@ No commands remaining.
You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
@@ -317,6 +320,7 @@ Next command to do (1 remaining command):
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
@@ -347,6 +351,7 @@ Next command to do (1 remaining command):
(use "git rebase --edit-todo" to view and edit)
You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(Once your working directory is clean, run "git rebase --continue")
+ (use "git rebase --abort" to check out the original branch)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
@@ -383,6 +388,7 @@ Next command to do (1 remaining command):
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
@@ -414,6 +420,7 @@ Next command to do (1 remaining command):
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
@@ -445,6 +452,7 @@ Next command to do (1 remaining command):
(use "git rebase --edit-todo" to view and edit)
You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(Once your working directory is clean, run "git rebase --continue")
+ (use "git rebase --abort" to check out the original branch)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
@@ -482,6 +490,7 @@ Next command to do (1 remaining command):
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
@@ -515,6 +524,7 @@ Next command to do (1 remaining command):
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
@@ -548,6 +558,7 @@ Next command to do (1 remaining command):
(use "git rebase --edit-todo" to view and edit)
You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(Once your working directory is clean, run "git rebase --continue")
+ (use "git rebase --abort" to check out the original branch)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
@@ -587,6 +598,7 @@ Next command to do (1 remaining command):
You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
@@ -718,6 +730,7 @@ No commands remaining.
You are currently editing a commit while rebasing branch '\''bisect'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
You are currently bisecting, started from branch '\''bisect_while_rebasing'\''.
(use "git bisect reset" to get back to the original branch)
@@ -987,6 +1000,7 @@ No commands remaining.
You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
@@ -1015,6 +1029,7 @@ Next commands to do (2 remaining commands):
You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
@@ -1044,6 +1059,7 @@ Next commands to do (2 remaining commands):
You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
@@ -1064,6 +1080,7 @@ Next command to do (1 remaining command):
You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
+ (use "git rebase --abort" to check out the original branch)
nothing to commit (use -u to show untracked files)
EOF
diff --git a/wt-status.c b/wt-status.c
index b17372390c..94fd14a058 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1527,9 +1527,12 @@ static void show_rebase_in_progress(struct wt_status *s,
else
status_printf_ln(s, color,
_("You are currently splitting a commit during a rebase."));
- if (s->hints)
+ if (s->hints) {
status_printf_ln(s, color,
_(" (Once your working directory is clean, run \"git rebase --continue\")"));
+ status_printf_ln(s, color,
+ _(" (use \"git rebase --abort\" to check out the original branch)"));
+ }
} else {
if (s->state.branch)
status_printf_ln(s, color,
@@ -1544,6 +1547,8 @@ static void show_rebase_in_progress(struct wt_status *s,
_(" (use \"git commit --amend\" to amend the current commit)"));
status_printf_ln(s, color,
_(" (use \"git rebase --continue\" once you are satisfied with your changes)"));
+ status_printf_ln(s, color,
+ _(" (use \"git rebase --abort\" to check out the original branch)"));
}
}
wt_longstatus_print_trailer(s);
base-commit: ea97ad8d017de0c9037451a78008a0fd60abea0c
--
gitgitgadget
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rebase: mention --abort alongside --continue
2026-06-15 19:19 [PATCH] rebase: mention --abort alongside --continue Harald Nordgren via GitGitGadget
@ 2026-06-16 8:36 ` Phillip Wood
2026-06-16 17:33 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Phillip Wood @ 2026-06-16 8:36 UTC (permalink / raw)
To: Harald Nordgren via GitGitGadget, git; +Cc: Harald Nordgren
Hi Harald
On 15/06/2026 20:19, Harald Nordgren via GitGitGadget wrote:
> From: Harald Nordgren <haraldnordgren@gmail.com>
>
> 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.
I'm not sure that the "failed exec" and "conflicts" cases are equivalent
though. If you have some nasty conflict that you don't want to resolve
then aborting and trying another approach such is incrementally rebasing
is the only option. If an exec command fails then it likely means that a
test has failed or some something similar which is minor inconvenience
which needs fixing before continuing - it seems very unlikely that the
user would want to abort the rebase.
Thanks
Phillip
> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
> ---
> rebase: mention --abort when an exec step fails
>
> Mention git rebase --abort both in the warning shown when an exec step
> fails and in the git status advice while splitting or editing a commit,
> since rebase pointed users at --continue there without saying how to
> bail out, unlike every comparable command.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2330%2FHaraldNordgren%2Frebase-exec-abort-hint-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2330/HaraldNordgren/rebase-exec-abort-hint-v1
> Pull-Request: https://github.com/git/git/pull/2330
>
> sequencer.c | 8 ++++++--
> t/t7512-status-help.sh | 17 +++++++++++++++++
> wt-status.c | 7 ++++++-
> 3 files changed, 29 insertions(+), 3 deletions(-)
>
> diff --git a/sequencer.c b/sequencer.c
> index 57855b0066..c46e5b95bc 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -3884,7 +3884,9 @@ static int do_exec(struct repository *r, const char *command_line, int quiet)
> "You can fix the problem, and then run\n"
> "\n"
> " git rebase --continue\n"
> - "\n"),
> + "\n"
> + "To abort and get back to the state before \"git rebase\", run "
> + "\"git rebase --abort\".\n"),
> command_line,
> dirty ? _("and made changes to the index and/or the "
> "working tree.\n") : "");
> @@ -3897,7 +3899,9 @@ static int do_exec(struct repository *r, const char *command_line, int quiet)
> "Commit or stash your changes, and then run\n"
> "\n"
> " git rebase --continue\n"
> - "\n"), command_line);
> + "\n"
> + "To abort and get back to the state before \"git rebase\", run "
> + "\"git rebase --abort\".\n"), command_line);
> status = 1;
> }
>
> diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
> index 08e82f7914..ca7ef66ae3 100755
> --- a/t/t7512-status-help.sh
> +++ b/t/t7512-status-help.sh
> @@ -206,6 +206,7 @@ No commands remaining.
> You are currently editing a commit while rebasing branch '\''rebase_i_edit'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> @@ -240,6 +241,7 @@ Next command to do (1 remaining command):
> (use "git rebase --edit-todo" to view and edit)
> You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
> (Once your working directory is clean, run "git rebase --continue")
> + (use "git rebase --abort" to check out the original branch)
>
> Changes not staged for commit:
> (use "git add <file>..." to update what will be committed)
> @@ -278,6 +280,7 @@ No commands remaining.
> You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> @@ -317,6 +320,7 @@ Next command to do (1 remaining command):
> You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> @@ -347,6 +351,7 @@ Next command to do (1 remaining command):
> (use "git rebase --edit-todo" to view and edit)
> You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
> (Once your working directory is clean, run "git rebase --continue")
> + (use "git rebase --abort" to check out the original branch)
>
> Changes not staged for commit:
> (use "git add <file>..." to update what will be committed)
> @@ -383,6 +388,7 @@ Next command to do (1 remaining command):
> You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> @@ -414,6 +420,7 @@ Next command to do (1 remaining command):
> You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> @@ -445,6 +452,7 @@ Next command to do (1 remaining command):
> (use "git rebase --edit-todo" to view and edit)
> You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
> (Once your working directory is clean, run "git rebase --continue")
> + (use "git rebase --abort" to check out the original branch)
>
> Changes not staged for commit:
> (use "git add <file>..." to update what will be committed)
> @@ -482,6 +490,7 @@ Next command to do (1 remaining command):
> You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> @@ -515,6 +524,7 @@ Next command to do (1 remaining command):
> You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> @@ -548,6 +558,7 @@ Next command to do (1 remaining command):
> (use "git rebase --edit-todo" to view and edit)
> You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
> (Once your working directory is clean, run "git rebase --continue")
> + (use "git rebase --abort" to check out the original branch)
>
> Changes not staged for commit:
> (use "git add <file>..." to update what will be committed)
> @@ -587,6 +598,7 @@ Next command to do (1 remaining command):
> You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> @@ -718,6 +730,7 @@ No commands remaining.
> You are currently editing a commit while rebasing branch '\''bisect'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> You are currently bisecting, started from branch '\''bisect_while_rebasing'\''.
> (use "git bisect reset" to get back to the original branch)
> @@ -987,6 +1000,7 @@ No commands remaining.
> You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> @@ -1015,6 +1029,7 @@ Next commands to do (2 remaining commands):
> You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> @@ -1044,6 +1059,7 @@ Next commands to do (2 remaining commands):
> You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> @@ -1064,6 +1080,7 @@ Next command to do (1 remaining command):
> You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
> (use "git commit --amend" to amend the current commit)
> (use "git rebase --continue" once you are satisfied with your changes)
> + (use "git rebase --abort" to check out the original branch)
>
> nothing to commit (use -u to show untracked files)
> EOF
> diff --git a/wt-status.c b/wt-status.c
> index b17372390c..94fd14a058 100644
> --- a/wt-status.c
> +++ b/wt-status.c
> @@ -1527,9 +1527,12 @@ static void show_rebase_in_progress(struct wt_status *s,
> else
> status_printf_ln(s, color,
> _("You are currently splitting a commit during a rebase."));
> - if (s->hints)
> + if (s->hints) {
> status_printf_ln(s, color,
> _(" (Once your working directory is clean, run \"git rebase --continue\")"));
> + status_printf_ln(s, color,
> + _(" (use \"git rebase --abort\" to check out the original branch)"));
> + }
> } else {
> if (s->state.branch)
> status_printf_ln(s, color,
> @@ -1544,6 +1547,8 @@ static void show_rebase_in_progress(struct wt_status *s,
> _(" (use \"git commit --amend\" to amend the current commit)"));
> status_printf_ln(s, color,
> _(" (use \"git rebase --continue\" once you are satisfied with your changes)"));
> + status_printf_ln(s, color,
> + _(" (use \"git rebase --abort\" to check out the original branch)"));
> }
> }
> wt_longstatus_print_trailer(s);
>
> base-commit: ea97ad8d017de0c9037451a78008a0fd60abea0c
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rebase: mention --abort alongside --continue
2026-06-16 8:36 ` Phillip Wood
@ 2026-06-16 17:33 ` Junio C Hamano
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2026-06-16 17:33 UTC (permalink / raw)
To: Phillip Wood; +Cc: Harald Nordgren via GitGitGadget, git, Harald Nordgren
Phillip Wood <phillip.wood123@gmail.com> writes:
> Hi Harald
>
> On 15/06/2026 20:19, Harald Nordgren via GitGitGadget wrote:
>> From: Harald Nordgren <haraldnordgren@gmail.com>
>>
>> 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.
>
> I'm not sure that the "failed exec" and "conflicts" cases are equivalent
> though. If you have some nasty conflict that you don't want to resolve
> then aborting and trying another approach such is incrementally rebasing
> is the only option. If an exec command fails then it likely means that a
> test has failed or some something similar which is minor inconvenience
> which needs fixing before continuing - it seems very unlikely that the
> user would want to abort the rebase.
It is very true that users who know what they are doing and got into
such conflicts are opted to go into such a situation tnat it is
unlikely that they would appreciate a choice to abort.
But given that for any system, everybody starts as a newbie, it may
be assuring to always give "here is a way out" option when they get
in a nasty confusing situation. Discouraging the way to use the
tool that can lead to confusing situation by guiding them with BCP
workflows would help, but they always get into pitfall.
The patch adds new message into the existing message to suggest how
to move forward, but as a training wheel option, it may not be a bad
thing to offer "--abort" as an extra hint, separate from the
existing warning() message.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-16 17:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-15 19:19 [PATCH] rebase: mention --abort alongside --continue Harald Nordgren via GitGitGadget
2026-06-16 8:36 ` Phillip Wood
2026-06-16 17:33 ` Junio C Hamano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.