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

Re: What's cooking in git.git (Jul 2026, #12)

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Aug 3, 2026, 09:05 UTC
Message-ID
<f00673cc-afc8-4a4f-a668-e22c53b46181@gmail.com>
In-Reply-To
<DKCKB3HW6VJA.19CQLPOHR6WTI@lfurio.us>
Hi Matt
On 31/07/2026 08:02, Matt Hunter wrote:
Show 14 quoted lines
> On Thu Jul 30, 2026 at 2:11 AM EDT, Harald Nordgren wrote:
>>> Without "--reedit-message", it will happily discard "amend!" and
>>> "squash!" commit messages even though the user creating them is a strong
>>> signal that they intended to use them to reword the commit.
>>> "--reedit-message" is a rather verbose option name which does not make
>>> sense to me as we're creating a new commit with a new message so we're
>>> not re-editing anything. I've commented elsewhere that I strongly
>>> dislike reusing the rebase squash message template for this command
>>> where we can squash fixups into multiple different commits at the same
>>> time.
> 
> I also agree with these points, but given that they were already brought
> up and dismissed before, I felt it wasn't my place to try to dictate
> high-level design.

If you raise a point and it is dismissed without a convincing explanation then its fine to raise it again asking for more details so that you can understand the reason behind the decision. That often leads to a productive discussion and an improved design.

Show 7 quoted lines
> I may be misunderstanding your current concern with the first sentence
> Phillip, but this was (at least in part) one of the recent things
> addressed in this feature [1] [2].  If we go with the assumption that the
> default behavior is to squash all the changes, but abandon all context
> outside that provided by the first commit, then accepting amend!
> messages for that first commit seems to drive the behavior closer to
> what you describe.

My feeling is that "amend!" and "squash!" commit messages indicate that the user intended to use them when they squashed so I think we should be a bit more careful about dropping them compared to other messages.

Show 8 quoted lines
>> Should we always do "--reedit-message" then, i.e. remove the option
>> and have it as the default? Do we need a "--no-edit" switch then
>> instead? Maybe not, user will then always have the editor opened and
>> they can save and quit if they don't care.
> 
> A script running 'git history squash' may have a harder time with this,
> though something like 'git -c core.editor=/bin/true history squash' is
> at least _some_ workaround.
Can't the script just pass --edit/--no-edit?
Show 6 quoted lines
> It would seem consistent with other git commands to offer both an --edit
> and --no-edit option.  If --edit is the default, it may make sense to
> offer the option anyway, for the sake of some potential future where
> there exists a config 'history.editSquashMsg' (for example).  '--edit'
> would then override a configured value of 'false'.  Of course, the
> precedent is --reedit-message so far in 'git history'.

That precedent is unfortunate, "--reedit-message" makes sense for the "fixup" subcommand because we are reediting an existing message but that's not the case with the "squash" subcommand where we're constructing a new message from several commits. Given how new the "fixup" subcommand is I'm tempted to add an "--edit" option and deprecate "--reedit-message".

Having thought about it a bit over the weekend I wonder if the best solution when squashing is to default to looking at the commits being squashed before deciding whether to open the editor or not and allow the user to override that on the commandline like "git commit". If we're squashing a bunch of "fixup!" and/or "amend!" commits into a single target then I'm not sure its worth opening the editor, but if we're squashing other commits together then it probably makes sense to open the editor so the user can check the result. I guess the danger is it ends up being confusing.

Thanks
Phillip
> 1: https://lore.kernel.org/git/DJY0QSJYNG0J.210HZQH198Y1N@lfurio.us/
> 2: https://lore.kernel.org/git/pull.2337.v9.git.git.1784128573.gitgitgadget@gmail.com/
Previous: Matt HunterNext: Junio C Hamano
Message 12 of 17 in “What's cooking in git.git (Jul 2026, #12)”
  1. Junio C HamanoJul 27, 2026
  2. Phillip WoodJul 29, 2026
  3. Junio C HamanoJul 29, 2026
  4. Phillip WoodJul 29, 2026
  5. Junio C HamanoJul 29, 2026
  6. Phillip WoodAug 5, 2026
  7. Junio C HamanoAug 5, 2026
  8. Matt HunterJul 31, 2026
  9. Junio C HamanoJul 31, 2026
  10. Harald NordgrenJul 30, 2026
  11. Matt HunterJul 31, 2026
  12. Phillip WoodAug 3, 2026
  13. Junio C HamanoAug 3, 2026
  14. Phillip WoodAug 4, 2026
  15. Phillip WoodAug 3, 2026
  16. Phillip WoodJul 29, 2026
  17. Junio C HamanoJul 29, 2026

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.