Re: [PATCH v5 0/4] history: add squash subcommand to fold a range
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 1, 2026, 17:41 UTC
- Message-ID
- <xmqqfr22obei.fsf@gitster.g>
- In-Reply-To
- <c517bce2-9f39-46ec-8509-bb0893e26ae2@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 27 quoted lines
> 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 subjectA better body.
or something? Is that the direction you want us to take?
Thanks.