From: Harald Nordgren Date: Fri, 22 May 2026 10:51:03 GMT Subject: Re: [PATCH v9 3/5] branch: add --prune-merged Message-ID: In-Reply-To: <6ae90274-3fbb-4d2a-b0f4-cd9260e4d6b3@gmail.com> > >> While we want to clean up topic branches, we want to avoid cleaning up > >> branches like "master" which follow an upstream branch and therefore > >> look like they've been merged straight after they've been pulled. So I > >> think as well as checking that the local branch is merged into its > >> upstream branch, we want to check that the local branch is not pushed to > >> the upstream branch i.e. that branch@{upstream} != branch@{push}. > > > > This one I handle already by letting the default branch be guarded. > > I used "master" as an example of a branch name above. There is no > guarantee that a remote even defines a default branch, let alone that > there is only one local branch where the its upstream and push > destinations match. I don't see how you can avoid checking that the > branch pushes to a different ref than its upstream and still be safe. Ok, I'll give it a shot! > I'm going to be off the list from now until the week after next, I'll > catch up with this thread when I'm back on line. Enjoy the time off! Harald