Re: [PATCH v5 0/4] history: add squash subcommand to fold a range
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jun 30, 2026, 13:48 UTC
- Message-ID
- <4b505228-4846-4a48-9255-e249f4e70a1f@gmail.com>
- In-Reply-To
- <CAHwyqnVN=McZjtQGcPnoVOHAd0+VDNPXy_N949VMsqZty3RDjQ@mail.gmail.com>
On 29/06/2026 22:13, Harald Nordgren wrote:
Show 7 quoted lines
>> You've trimmed the line where I said >> >> >> Possibly with a comment before each message saying where it came >> >> from. > > Sorry about that! Can you show me the example of what it would look > like? It's much easier for me to reason about it then.
For the commits
123 Commit one
456 Commit two
789 fixup! Commit one
abc squash! Commit two
def amend! Commit oneIt would look something like
# This is the combination of the following commits:
# 123 Commit one
# 789 fixup! Commit one
# def amend! Commit one
# 456 Commit two
# abc squash! Commit twoA better commit one subject
A better commit one body
# ------------------------------------
Commit two
Commit two body
# squash! Commit two
More text for commit two
I've rearranged the commits in the summary to keep fixup commits with their targets instead of listing them in the same order of "git log --reverse". As we're dropping uninteresting messages I not sure there is much point in numbering them[1] so I've just used a plain separator to show where a message ends. For squash! commits commenting out the subject shows where the original message ends and the message from the squash! commit begins. I'm on the fence as to whether it is worth having
# amend! Commit one
above the first message
Thanks
Phillip
[1] If we really want to number things we could number each commit in
the summary and then use that to label it in the message template
with separators like# This is the message from commit <n>
instead of separating them with
# ----------------------------