Volume XXII, number 279Tuesday, October 6, 2026Latest message 39 minutes ago

The Git List

News and archive of git@vger.kernel.org, since April 2005

patchrebase: mention --abort alongside --continue

14 messages between Jun 15, 2026 and Jul 20, 2026, from Harald Nordgren via GitGitGadget, Phillip Wood, Junio C Hamano, Harald Nordgren.

Plain Markdown or JSON for tools and agents. Diffs are folded; open one to read it.

Harald Nordgren via GitGitGadgetJun 15, 2026, 19:19 UTC on lore
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(-)
Show changes to 3 files +29 −3

sequencer.c, t/t7512-status-help.sh, wt-status.c

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
Phillip WoodJun 16, 2026, 08:36 UTC in reply to Harald Nordgren via GitGitGadget on lore

Re: [PATCH] rebase: mention --abort alongside --continue

Hi Harald
On 15/06/2026 20:19, Harald Nordgren via GitGitGadget wrote:
Show 6 quoted lines
> 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
Show 213 quoted lines
> 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
Junio C HamanoJun 16, 2026, 17:33 UTC in reply to Phillip Wood on lore

Re: [PATCH] rebase: mention --abort alongside --continue

Phillip Wood <phillip.wood123@gmail.com> writes:
Show 17 quoted lines
> 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.

Harald NordgrenJun 17, 2026, 08:56 UTC in reply to Junio C Hamano on lore

Re: [PATCH] rebase: mention --abort alongside --continue

For the record, I have gotten into ill-fated rebases, and then it would have been nice to have that message there. Sometimes you realize after starting that you chose the wrong upstream, etc.

Harald
Phillip WoodJun 17, 2026, 09:52 UTC in reply to Junio C Hamano on lore

Re: [PATCH] rebase: mention --abort alongside --continue

On 16/06/2026 18:33, Junio C Hamano wrote:
Show 23 quoted lines
> 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.

That's not quite what I was trying to say which was that aborting in the case of conflicts is more likely than in the case of a failed exec.

Show 10 quoted lines
> 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.

So if I've understood we'd print a message explaining what's happened and how to continue followed by a hint about aborting. The message would depend on what problem caused the rebase to stop, but the hint would be the same in each case. That sounds fine to me.

Thanks
Phillip
Junio C HamanoJun 17, 2026, 12:19 UTC in reply to Phillip Wood on lore

Re: [PATCH] rebase: mention --abort alongside --continue

Phillip Wood <phillip.wood123@gmail.com> writes:
Show 6 quoted lines
>> 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.
>
> That's not quite what I was trying to say which was that aborting in the 
> case of conflicts is more likely than in the case of a failed exec.

Ah, I misread the intention. And I agree with you that "failed test" case is very likely to lead to "further changes/amends" and not "aborted rebase".

> So if I've understood we'd print a message explaining what's happened 
> and how to continue followed by a hint about aborting. The message would 
> depend on what problem caused the rebase to stop, but the hint would be 
> the same in each case. That sounds fine to me.

Yeah, and "failed test" would not be one of the problem that would invite the hint to "abort". I am OK with that, too. FWIW, I am OK if the "you can abort" hint cannot be configured away, either ;-)

Harald NordgrenJun 18, 2026, 18:49 UTC in reply to Junio C Hamano on lore

Re: [PATCH] rebase: mention --abort alongside --continue

Just an example when working on a different topic:

I rebased with -x to run all the tests, but ran a test that didn't exist yet on the first commit and ended up in a bad state. Here it should clearly show the 'git rebase --abort', so I can start over, it's not something to fix:

```
$ git rebase --keep-base -x 'make -s' -x 'cd t && prove -j8
t3454-history-squash.sh t3453-history-fixup.sh t3452-history-split.sh
t3451-history-reword.sh t3450-history.sh'
Executing: make -s
GIT_VERSION=2.55.0.rc1.20.g1e31474ef6
Executing: cd t && prove -j8 t3454-history-squash.sh
t3453-history-fixup.sh t3452-history-split.sh t3451-history-reword.sh
t3450-history.sh
Cannot detect source of 't3454-history-squash.sh'! at
/System/Library/Perl/5.34/TAP/Parser/IteratorFactory.pm line 256.
...
warning: execution failed: cd t && prove -j8 t3454-history-squash.sh
t3453-history-fixup.sh t3452-history-split.sh t3451-history-reword.sh
t3450-history.sh
You can fix the problem, and then run
  git rebase --continue
$ git status
interactive rebase in progress; onto 95e20213fa
Last commands done (3 commands done):
   exec make -s
   exec cd t && prove -j8 t3454-history-squash.sh
t3453-history-fixup.sh t3452-history-split.sh t3451-history-reword.sh
t3450-history.sh
  (see more in file .git/rebase-merge/done)
Next commands to do (9 remaining commands):
   pick 498da64046 # history: give commit_tree_ext a message template
   exec make -s
  (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch
'rebase-fixup-fold' on '95e20213fa'.
  (use "git commit --amend" to amend the current commit)
  (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit, working tree clean ```

Harald
On Wed, Jun 17, 2026 at 2:19 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
>
> Phillip Wood <phillip.wood123@gmail.com> writes:
>
> >> 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.
> >
> > That's not quite what I was trying to say which was that aborting in the
> > case of conflicts is more likely than in the case of a failed exec.
>
> Ah, I misread the intention.  And I agree with you that "failed
> test" case is very likely to lead to "further changes/amends" and
> not "aborted rebase".
>
> > So if I've understood we'd print a message explaining what's happened
> > and how to continue followed by a hint about aborting. The message would
> > depend on what problem caused the rebase to stop, but the hint would be
> > the same in each case. That sounds fine to me.
>
> Yeah, and "failed test" would not be one of the problem that would
> invite the hint to "abort".  I am OK with that, too.  FWIW, I am OK
> if the "you can abort" hint cannot be configured away, either ;-)
>
Junio C HamanoJun 19, 2026, 01:36 UTC in reply to Harald Nordgren on lore

Re: [PATCH] rebase: mention --abort alongside --continue

Harald Nordgren <haraldnordgren@gmail.com> writes:
Show 25 quoted lines
> Just an example when working on a different topic:
>
> I rebased with -x to run all the tests, but ran a test that didn't
> exist yet on the first commit and ended up in a bad state. Here it
> should clearly show the 'git rebase --abort', so I can start over,
> it's not something to fix:
>
> ```
> $ git rebase --keep-base -x 'make -s' -x 'cd t && prove -j8
> t3454-history-squash.sh t3453-history-fixup.sh t3452-history-split.sh
> t3451-history-reword.sh t3450-history.sh'
> Executing: make -s
> GIT_VERSION=2.55.0.rc1.20.g1e31474ef6
> Executing: cd t && prove -j8 t3454-history-squash.sh
> t3453-history-fixup.sh t3452-history-split.sh t3451-history-reword.sh
> t3450-history.sh
> Cannot detect source of 't3454-history-squash.sh'! at
> /System/Library/Perl/5.34/TAP/Parser/IteratorFactory.pm line 256.
> ...
> warning: execution failed: cd t && prove -j8 t3454-history-squash.sh
> t3453-history-fixup.sh t3452-history-split.sh t3451-history-reword.sh
> t3450-history.sh
> You can fix the problem, and then run
>
>   git rebase --continue

Hmph, you do not have to "fix" as you know some of the test scripts did not exist at this stage. So the solution to the issue seems to be just to say "git rebase --continue", instead of starting over by aborting. It is especially true if the test scripts are introduced in the middle of this rebase session somewhere later in the series, no?

Of course if you gave a totally broken script to "-x" option, you'd need to be able to abort it, but is that the use case we should be giving one extra line of output for users in all other situations? I dunno.

Harald NordgrenJul 16, 2026, 06:02 UTC in reply to Junio C Hamano on lore

Re: [PATCH] rebase: mention --abort alongside --continue

I'll revive this discussion because the 'git rebase --keep-base -x' case still bothers me.

When getting stuck in the middle of an operation, it just makes sense to offer a way forward and a way back, why be more obtuse than we need to?

Harald
Phillip WoodJul 16, 2026, 09:37 UTC in reply to Harald Nordgren on lore

Re: [PATCH] rebase: mention --abort alongside --continue

Hi Harald
On 16/07/2026 07:02, Harald Nordgren wrote:
Show 6 quoted lines
> I'll revive this discussion because the 'git rebase --keep-base -x'
> case still bothers me.
> 
> When getting stuck in the middle of an operation, it just makes sense
> to offer a way forward and a way back, why be more obtuse than we need
> to?

I'm still not clear why you'd want to abort after a failed exec. In the example you gave earlier in the thread where the exec command was trying to run a command that did not exist isn't the solution to edit the todo list to fix that, or if just this exec command is wrong, continue the rebase?

In the latter case it would be useful is to teach "git rebase --skip" to skip a failed exec command that has been rescheduled by "--reschedule-failed-exec" and provide a hint to the user that they can skip the rescheduled command. We could potentially add a hint to suggest that if the failure was due to a bad command then the user should edit the todo list.

To me aborting a rebase because an exec command failed is almost never a sensible route forward and we should not be encouraging users to abort after a failed test - surely the sensible thing to do in that case is fix the problem with "git commit --amend" and continue the rebase.

Thanks
Phillip
Junio C HamanoJul 16, 2026, 17:24 UTC in reply to Phillip Wood on lore

Re: [PATCH] rebase: mention --abort alongside --continue

Phillip Wood <phillip.wood123@gmail.com> writes:
> To me aborting a rebase because an exec command failed is almost never a 
> sensible route forward and we should not be encouraging users to abort 
> after a failed test - surely the sensible thing to do in that case is 
> fix the problem with "git commit --amend" and continue the rebase.

My conclusion, from my own experience with "git rebase", is the same.

I wonder if the workflow that benefits from this "if exec fails, give up and forget the whole thing" behavior is actually quite different from what we consider the "normal" use of the command? Perhaps the user is not interested in "rebasing" the history at all, but is instead running a check on each and every commit. That is, a more expensive version of:

        for commit in $(git rev-list bottom..top)
        do
                git reset --hard "$commit" &&
                do the exec command || break
        done
that just happens to be shorter to type?
Harald NordgrenJul 18, 2026, 08:05 UTC in reply to Junio C Hamano on lore

Re: [PATCH] rebase: mention --abort alongside --continue

Show 14 quoted lines
> I wonder if the workflow that benefits from this "if exec fails,
> give up and forget the whole thing" behavior is actually quite
> different from what we consider the "normal" use of the command?
> Perhaps the user is not interested in "rebasing" the history at
> all, but is instead running a check on each and every commit.
> That is, a more expensive version of:
>
>         for commit in $(git rev-list bottom..top)
>         do
>                 git reset --hard "$commit" &&
>                 do the exec command || break
>         done
>
> that just happens to be shorter to type?
Sure, that's exactly right.
Harald
Phillip WoodJul 18, 2026, 09:25 UTC in reply to Harald Nordgren on lore

Re: [PATCH] rebase: mention --abort alongside --continue

On 18/07/2026 09:05, Harald Nordgren wrote:
Show 15 quoted lines
>> I wonder if the workflow that benefits from this "if exec fails,
>> give up and forget the whole thing" behavior is actually quite
>> different from what we consider the "normal" use of the command?
>> Perhaps the user is not interested in "rebasing" the history at
>> all, but is instead running a check on each and every commit.
>> That is, a more expensive version of:
>>
>>          for commit in $(git rev-list bottom..top)
>>          do
>>                  git reset --hard "$commit" &&
>>                  do the exec command || break
>>          done
>>
>> that just happens to be shorter to type?
>> Sure, that's exactly right.

I think I must be missing something; I had assumed that someone running a check on each commit wanted to ensure it passed, and, if not, they would want to fix the problem that caused the check to fail. In that case I would expect that they would want to amend the failing commit, rather than abort the rebase. What's the scenario where one wants to check a bunch of commits but not fix the ones that fail?

Thanks
Phillip
Junio C HamanoJul 20, 2026, 02:29 UTC in reply to Phillip Wood on lore

Re: [PATCH] rebase: mention --abort alongside --continue

Phillip Wood <phillip.wood123@gmail.com> writes:
Show 12 quoted lines
>>> Perhaps the user is not interested in "rebasing" the history at
>>> all, but is instead running a check on each and every commit.
>>> That is, a more expensive version of:
>>>
>>>          for commit in $(git rev-list bottom..top)
>>>          do
>>>                  git reset --hard "$commit" &&
>>>                  do the exec command || break
>>>          done
>>>
>>> that just happens to be shorter to type?
>>> Sure, that's exactly right.
Show 6 quoted lines
> I think I must be missing something; I had assumed that someone running 
> a check on each commit wanted to ensure it passed, and, if not, they 
> would want to fix the problem that caused the check to fail. In that 
> case I would expect that they would want to amend the failing commit, 
> rather than abort the rebase. What's the scenario where one wants to 
> check a bunch of commits but not fix the ones that fail?

I suspect that is what makes this user "not interested in 'rebasing'". If finding a single breakage in the history is all they want to accomplish (perhaps because they merely file a bug report and make it someone else's job to fix it), they have no desire to amend and continue the run to find further problems in subsequent commits.

Which, of course, makes me even less sympathetic to the proposed change.

Thanks.

Back to recent threads