From: Johannes Sixt Date: Tue, 05 May 2026 07:14:07 GMT Subject: Re: [PATCH] fetch: add fetch.pruneLocalBranches config Message-ID: In-Reply-To: Am 04.05.26 um 00:39 schrieb Junio C Hamano: > To break the feature down to make it easier to use by our users with > various needs and workflows, we would benefit from having a > collection of smaller features that can be composed, like these: > > * "git branch --forked " lists local branches that build on > something taken from s. The option can be given multiple > times to make a union of the results from individual "--forked > ". Clearly, this version of --forked does something very different from the option `--merged some_branch` that we already have. > > - may be a name of a remote, e.g., "origin" to mean all > the remote-tracking branches "refs/remotes/origin/*", > > - may be "origin/master" to name a specific > remote-tracking branch. > > - There may be other handy things to cover with , like > "--all" that may act as if you listed all the available > on the command line. > > * "git branch --prune-merged ..." is a short-hand for "git > branch -d $(git branch --forked ...". I don't understand this. The option includes the word "merged". Then I interpret the command to prune only branches that have already been merged into something (BTW, merged into what?), but as described, the command removes all local branches that have been forked from some (remote) branch. > > * "git fetch/pull --prune-merged " can trigger "git branch > --prune-merged " after "git fetch" successfully updates > the remote-tracking branches, which should be equivalent to what > you have here.. I think that the intended behavior is to call the equivalent of `git branch --merged X | xargs git branch -d` for a suitable set of 'X' to be determined by `git fetch`. -- Hannes