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

Re: [PATCH] rebase -i: improve error message when picking merge

From
Rubén Justo <rjusto@gmail.com>
Date
Apr 6, 2024, 14:24 UTC
Message-ID
<7e4eae67-8db9-4be3-8b96-e2e89fa82abf@gmail.com>
In-Reply-To
<dbb4615c-443f-474f-a33c-cfb4486d436b@gmail.com>
On Fri, Apr 05, 2024 at 10:30:37AM +0100, phillip.wood123@gmail.com wrote:
Show 40 quoted lines
> Hi Rubén
> 
> Thanks for trying this out.
> 
> On 04/04/2024 20:44, Rubén Justo wrote:
> > On Mon, Feb 26, 2024 at 10:58:07AM +0000, Phillip Wood via GitGitGadget wrote:
> > The change makes sense, but this is confusing to me:
> > 
> > With this ...
> > 
> > 	$ GIT_EDITOR='echo pick 17381ab62a >' ./git rebase -i HEAD
> > 	error: 'pick' does not accept merge commits, please use 'merge -C'
> > 	error: invalid line 1: pick 17381ab62a
> > 	You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
> > 	Or you can abort the rebase with 'git rebase --abort'.
> > 
> > ... I find these repeated messages confusing:
> > 
> > 	$ GIT_EDITOR=: ./git rebase --edit-todo
> > 	error: 'pick' does not accept merge commits, please use 'merge -C'
> > 	error: invalid line 1: pick 17381ab62a
> 
> The two lines above are printed when "rebase --edit-todo" loads the todo
> list for the user to edit. With a real editor rather than ":" we would then
> print
> 
>     hint: Waiting for your editor to close the file ...
> 
> Then hopefully the user would fix the errors. If not then when the editor
> had finished we'd print the remaining errors  as below.
> 
> > 	error: 'pick' does not accept merge commits, please use 'merge -C'
> > 	error: invalid line 1: pick 17381ab62a
> > 	You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
> > 	Or you can abort the rebase with 'git rebase --abort'.
> 
> I think that printing the error messages when the todo list is parsed before
> it is given to the user to edit is helpful as it reminds the user what the
> problem is. Your test looks confusing because it doesn't really simulate the
> user editing the todo list.
Certainly, the test was not clear to express my confusion.

The ones that are printed _before_ the editor is run are the ones that confuse me, because when the user exits the editor we leave those lines there:

	$ GIT_EDITOR='sed -i s/pick/merge/' ./git rebase --edit
	error: 'pick' does not accept merge commits, please use 'merge -C'
	error: invalid line 1: pick 17381ab62a

But maybe it is my interpretation. Your reasoning of giving it as a help to the user makes sense.

Thank you for your explanations.
> Best Wishes
> 
> Phillip
Previous: phillip.wood123@gmail.comNext: phillip.wood123@gmail.com
Message 8 of 26 in “rebase -i: improve error message when picking merge”
  1. rebase -i: improve error message when picking mergePhillip Wood via GitGitGadget, Feb 26, 2024
  2. phillip.wood123@gmail.comApr 3, 2024
  3. Patrick SteinhardtApr 4, 2024
  4. Patrick SteinhardtApr 4, 2024
  5. phillip.wood123@gmail.comApr 4, 2024
  6. Rubén JustoApr 4, 2024
  7. phillip.wood123@gmail.comApr 5, 2024
  8. Rubén JustoApr 6, 2024
  9. phillip.wood123@gmail.comApr 7, 2024
  10. 0/2 rebase -i: improve error message when picking mergePhillip Wood via GitGitGadget, Apr 8, 2024
  11. 1/2 rebase -i: pass struct replay_opts to parse_insn_line()Phillip Wood via GitGitGadget, Apr 8, 2024
  12. Patrick SteinhardtApr 9, 2024
  13. 2/2 rebase -i: improve error message when picking mergePhillip Wood via GitGitGadget, Apr 8, 2024
  14. Junio C HamanoApr 8, 2024
  15. Patrick SteinhardtApr 9, 2024
  16. Junio C HamanoApr 9, 2024
  17. Patrick SteinhardtApr 9, 2024
  18. Phillip WoodApr 9, 2024
  19. Junio C HamanoApr 9, 2024
  20. Phillip WoodApr 12, 2024
  21. 0/2 rebase -i: improve error message when picking mergePhillip Wood via GitGitGadget, May 30, 2024
  22. 1/2 rebase -i: pass struct replay_opts to parse_insn_line()Phillip Wood via GitGitGadget, May 30, 2024
  23. 2/2 rebase -i: improve error message when picking mergePhillip Wood via GitGitGadget, May 30, 2024
  24. Junio C HamanoMay 30, 2024
  25. Phillip WoodJun 3, 2024
  26. Junio C HamanoJun 3, 2024

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.