git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/2] rebase -i: introduce the 'break' command

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 12, 2018, 11:24 UTC
Message-ID
<nycvar.QRO.7.76.6.1810121322280.561@tvgsbejvaqbjf.bet>
In-Reply-To
<3e2f9343-8b01-c6e5-9425-1665920cc920@talktalk.net>
Hi Phillip,
On Fri, 12 Oct 2018, Phillip Wood wrote:
Show 49 quoted lines
> Hi Johannes
> On 12/10/2018 09:35, Johannes Schindelin wrote:
> > Hi Phillip,
> > 
> > On Thu, 11 Oct 2018, Phillip Wood wrote:
> > 
> >> I think this would be a useful addition to rebase, there's one small
> >> comment below.
> >>
> >> On 10/10/2018 09:53, Johannes Schindelin via GitGitGadget wrote:
> >>> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >>>
> >>> The 'edit' command can be used to cherry-pick a commit and then
> >>> immediately drop out of the interactive rebase, with exit code 0, to let
> >>> the user amend the commit, or test it, or look around.
> >>>
> >>> Sometimes this functionality would come in handy *without*
> >>> cherry-picking a commit, e.g. to interrupt the interactive rebase even
> >>> before cherry-picking a commit, or immediately after an 'exec' or a
> >>> 'merge'.
> >>>
> >>> This commit introduces that functionality, as the spanking new 'break'
> >>> command.
> >>>
> >>> Suggested-by: Stefan Beller <sbeller@google.com>
> >>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> >>> ---
> 
> >>> diff --git a/sequencer.c b/sequencer.c
> >>> index 8dd6db5a01..b209f8af46 100644
> >>> --- a/sequencer.c
> >>> +++ b/sequencer.c
> 
> >>> @@ -3293,6 +3295,9 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
> >>>  			unlink(rebase_path_stopped_sha());
> >>>  			unlink(rebase_path_amend());
> >>>  			delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
> >>> +
> >>> +			if (item->command == TODO_BREAK)
> >>> +				break;
> >>
> >> Normally when rebase stops it prints a message to say where it has got
> >> to and how to continue, it might be useful to do the same here
> > 
> > That's a very valid point. I'll think of something.
> 
> I'm not sure what gets left on the screen from the previous picks but
> something to say what the last pick/exec was and maybe what the current
> HEAD is would be useful I think.

I first wanted to do that, imitating the "Stopped at <hex>... <oneline>" of an `edit` command, but it *is* now possible that we are on an unborn branch... which will look a bit funny, I guess, as we construct a very special place-holder commit to be HEAD in that case.

> One thing has just occurred to me - what does git status say (and does
> it still work - I'm not sure how much parsing it does on the todo and
> done files) if it is run while rebase is stopped on a break command?

I don't think it says anything special, really. It just reports that we're in the middle of a rebase, listing up to two already-processed and up to two to-be-processed todo commands.

Ciao, Dscho

Previous: Phillip WoodNext: Johannes Schindelin via GitGitGadget
Message 17 of 27 in “rebase -i: introduce the 'break' command”
  1. 0/1 rebase -i: introduce the 'break' commandJohannes Schindelin via GitGitGadget, Oct 3, 2018
  2. 1/1 rebase -i: introduce the 'break' commandJohannes Schindelin via GitGitGadget, Oct 3, 2018
  3. Junio C HamanoOct 5, 2018
  4. Jacob KellerOct 5, 2018
  5. Johannes SchindelinOct 5, 2018
  6. Junio C HamanoOct 9, 2018
  7. Junio C HamanoOct 9, 2018
  8. 0/2 rebase -i: introduce the 'break' commandJohannes Schindelin via GitGitGadget, Oct 10, 2018
  9. 1/2 rebase -i: clarify what happens on a failed `exec`Johannes Schindelin via GitGitGadget, Oct 10, 2018
  10. Eric SunshineOct 10, 2018
  11. Junio C HamanoOct 11, 2018
  12. Johannes SchindelinOct 12, 2018
  13. 2/2 rebase -i: introduce the 'break' commandJohannes Schindelin via GitGitGadget, Oct 10, 2018
  14. Phillip WoodOct 11, 2018
  15. Johannes SchindelinOct 12, 2018
  16. Phillip WoodOct 12, 2018
  17. Johannes SchindelinOct 12, 2018
  18. 0/2 rebase -i: introduce the 'break' commandJohannes Schindelin via GitGitGadget, Oct 12, 2018
  19. 1/2 rebase -i: clarify what happens on a failed `exec`Johannes Schindelin via GitGitGadget, Oct 12, 2018
  20. 2/2 rebase -i: introduce the 'break' commandJohannes Schindelin via GitGitGadget, Oct 12, 2018
  21. Junio C HamanoOct 12, 2018
  22. Johannes SchindelinOct 12, 2018
  23. Junio C HamanoOct 12, 2018
  24. Johannes SchindelinOct 12, 2018
  25. 3/2 rebase -i: recognize short commands without argumentsJohannes Sixt, Oct 25, 2018
  26. Junio C HamanoOct 26, 2018
  27. Johannes SchindelinOct 26, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.