From: Phillip Wood Date: Mon, 22 Jun 2026 09:57:06 GMT Subject: Re: [PATCH v14 4/6] branch: add --prune-merged Message-ID: In-Reply-To: On 22/06/2026 10:37, Harald Nordgren wrote: > Hi! I implemented this in v17. That seems to preserve all the upstreams, rather than preserving the upstreams of unmerged branches and clearing the upstream setting of merged branches. It also builds a list of upstream branches rather than just pruning the set of to-be-deleted branches in the refs_for_each_branch_ref() callback which seems a bit wasteful. Thanks Phillip > > Harald > > On Mon, Jun 22, 2026 at 11:28 AM Phillip Wood wrote: >> >> On 22/06/2026 10:09, Phillip Wood wrote: >>> Hi Harald >>> >>> On 21/06/2026 19:46, Harald Nordgren wrote: >>>> Looking into this more and attempting to implement the logic for >>>> re-assigning the upstream, it becomes quite a lot of code. >> >> Having re-read you previous message I'm coming round to the idea of >> clearing the upstream of branches that have been merged but cannot be >> deleted because they are the upstream of an unmerged branch. Is that >> easier than reassigning the upstream? >> >> Thanks >> >> Phillip >> >>>> Maybe an easier way forward now is to avoid deleting these cases. We >>>> can always add the re-assigning logic later on without breaking >>>> backward compatibility. >>> >>> Not deleting the branch is certainly safest and should be fairly easy to >>> implement. Adding an option to reassign the upstream later sounds fine >>> to me. >>> >>> Thanks >>> >>> Phillip >>> >>