From: Harald Nordgren Date: Sun, 04 Oct 2026 22:28:36 GMT Subject: Re: [PATCH] branch: let --delete-merged find squash merged branches Message-ID: In-Reply-To: <39a28064-1698-4971-a80f-4a4c4dcdd8d9@gmail.com> > As far as I can see the implementation here makes a separate upstream > revision walk for each branch, and recalculates the upstream diffs each > time which seems less efficient than it could be. Yes, that can be improved! > > In the squash case, I suppose the best we can do is check that all our > > changes were applied at some point between the merge-base and the tip. > > There probably won't be any tree-same commits, though maybe a > > (premature?) optimization can return early if the trees match exactly. ... > If you know your repository only has squash merges that were not rebased > it would be a lot more efficient to just look at the trees and > merge-bases, especially in a blobless clone. Having an option to turn > off the patch-id based detection would probably be useful in that case. Maybe yes, but for users I imagine they want the interface to be as simple as possible. I'm iterating on the code on my side (sharing logic between branches, etc) and it became fast on my local Git repo. If there are no performance concerns then would we still want the option to turn it off? Harald