Re: [PATCH v2 0/2] branch: let --delete-merged find squash merged branches
- From
Harald Nordgren <haraldnordgren@gmail.com>
- Date
- Oct 12, 2026, 14:31 UTC
- Message-ID
- <CAHwyqnUP8Bgd4S=oE9g0TonqL-ohy4LXXG66AY8SeVk=6HCNUg@mail.gmail.com>
- In-Reply-To
- <03b187ae-bef2-426f-b6a4-def9f70c4a3f@gmail.com>
> I think it would be helpful if the cover letter explained in more detail > what this series actually does to detect squashed merges and compared > that to other approaches such as using patch ids or test merges.
Ok.
Show 10 quoted lines
> As far
> as I can see the approach here is, to a first approximation, checking
>
> $(git merge-tree B C) == C^{tree}
>
> to see if C is a squashed merge of B, only without using merge-ort but
> by calling merge_ll() on each path instead. That means we're not
> checking if C is the same as merging B into C^, C may contain additional
> changes as well. I think it also means we're missing out on rename
> detection.The check is "does C already contain everything B changed", not "is C exactly the squash of B". For deleting the branch it could be enough since nothing is lost.
But it means "landed as" can point to a commit with other changes in it as well, maybe that's not good.
I think following renames is a bad basis for assuming merged. Sometimes the goal of a topic is a rename, and then it should not be dropped.
Harald