Re: [PATCH v5 0/4] history: add squash subcommand to fold a range
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jul 2, 2026, 13:58 UTC
- Message-ID
- <dd692c2d-87ca-4618-ae34-7e5e90ffa515@gmail.com>
- In-Reply-To
- <xmqqfr22obei.fsf@gitster.g>
On 01/07/2026 18:41, Junio C Hamano wrote:
Show 31 quoted lines
> Phillip Wood <phillip.wood123@gmail.com> writes: > >> Yes - if you apply the way "rebase -i" works to multiple commits you can >> end up with a message template that has a screen full of commented lines >> between uncommitted parts of the message. See the example below from >> earlier in the thread. It is not so much of a problem in "rebase -i" >> because it only fixes up a single commit at a time so all the commented >> messages end up at the top of the buffer and at worst you have a few "# >> fixup! ..." or "# squash! ..." lines mixed in with the uncommitted text. >> >> # This is the combination of 4 commits >> # This is the first commit message >> Base subject >> >> Base body >> >> # This is the second commit message >> # Another subject >> >> # Another body >> >> # This is the third commit message >> # fixup! Base subject >> >> # This is the fourth commit message >> # amend! Another subject >> A better subject >> >> A better body > > In the example, the second one becomes completely empty?
Yes because there is an amend! commit that replaces its message
Show 8 quoted lines
> Is the proposal not to show any messages that will be discarded > anyway and not even show them in commented form? I think that makes > sense, and leaving only commit titles for these commits that would > not contribute to the text in the editor given to the user to edit > would indeed be an improvement. For the same reason, as "# amend!" > will replace the message wholesale, it would also be a good idea for > the first commit to be hidden like all the other commits that would > not contribute to the text,
But the amend! commit does not target the first commit - it replaces the message of the second commit so I think we should keep the first message as shown below. You can see a different example with a squash! message at [1]
Show 5 quoted lines
> # This is the combination fo 4 commits > # 1. Base subject > # 2. Another subject > # 3. fixup! Base subject > # 4. amend! Another subject
Base subject
Base body
# -------------------------------------
> A better subject > > A better body.
Thanks
Phillip
[1] https://lore.kernel.org/git/4b505228-4846-4a48-9255-e249f4e70a1f@gmail.com