Re: [PATCH v5 0/4] history: add squash subcommand to fold a range
From: Junio C Hamano <hidden>
Date: 2026-07-01 17:41:28
Phillip Wood [off-list ref] 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?
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, so an improved version of the above may
be:
# This is the combination fo 4 commits
# 1. Base subject
# 2. Another subject
# 3. fixup! Base subject
# 4. amend! Another subject
A better subject
A better body.
or something? Is that the direction you want us to take?
Thanks.