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

Re: [PATCH] rebase -i: allow a comment after a "break" command

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 13, 2023, 20:17 UTC
Message-ID
<xmqqwn5q1960.fsf@gitster.g>
In-Reply-To
<CABPp-BFf4pbRAy+Oaghx5d8DZgBjY_OUM-rJZna+JyNwx9WB-Q@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 14 quoted lines
> Of course, the same applies to edit/squash/fixup/reword, though if I
> could go back in time...(warning, long tangent coming)...I would make
> it so those four directives did not accept any commit ID argument.
> Only "pick" and "reset" would accept a commit ID.  Instead, today's
> "edit X" would be two commands ("pick X" followed by either "break" or
> "edit"), "fixup X" would be "pick X" + "fixup", and "reword X" would
> be "pick X" + "reword".  That'd help users understand rebase state
> much better (it's so easy for users to get confused by whether they
> should be using `git commit --amend` vs. `git rebase --continue` and I
> think this is partially to blame, though there's other changes we
> could make to help with that dichotomy as well).  The separate
> directives would also make it much easier to figure out how to both
> fixup and edit a single commit in the same rebase (pick the commit,
> then add a fixup directive, then an edit directive).  

Intriguing, and I feel sad that it probably is too late for all of the above X-<.

> In fact, "squash
> X" could just be discarded as superfluous, since it's just "pick X" +
> "fixup" + "reword" (or we could keep squash as an abbreviation for
> both "fixup" + "reword").
IIUC, your "fixup" is
	git reset --soft HEAD^
	git commit --amend --no-edit

i.e. discard the log message from "fixup" and use only its tree, and your "reword" is

	git commit --amend --edit

so "pick X" + "fixup" + "reword" would not be quite usable as a replacement of our "squash X" (or your "pick X" + "squash"), I am afraid. You'd want the log message from "X" as well as "X^" to edit the replacement of X^.

Previous: Elijah NewrenNext: Elijah Newren
Message 11 of 18 in “rebase -i: allow a comment after a "break" command”
  1. rebase -i: allow a comment after a "break" commandPhillip Wood via GitGitGadget, Jan 12, 2023
  2. Andrei RybakJan 12, 2023
  3. Phillip WoodJan 12, 2023
  4. Olliver SchinaglJan 12, 2023
  5. Ævar Arnfjörð BjarmasonJan 12, 2023
  6. Olliver SchinaglJan 12, 2023
  7. Phillip WoodJan 12, 2023
  8. Ævar Arnfjörð BjarmasonJan 12, 2023
  9. Elijah NewrenJan 12, 2023
  10. Elijah NewrenJan 12, 2023
  11. Junio C HamanoJan 13, 2023
  12. Elijah NewrenJan 14, 2023
  13. Junio C HamanoJan 12, 2023
  14. Phillip WoodJan 12, 2023
  15. Jeff KingJan 12, 2023
  16. Junio C HamanoJan 13, 2023
  17. Sergey OrganovJan 13, 2023
  18. Phillip WoodJan 17, 2023

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.