From: D. Ben Knoble Date: Sat, 24 Oct 2026 13:14:21 GMT Subject: Re: [RFC] branch: delete gone-upstream branches only when proven merged into a named ref Message-ID: In-Reply-To: On Thu, Oct 22, 2026 at 9:44 AM Harald Nordgren wrote: > > > Ah, but the manual seems to contradict my (personal) "natural" reading > > of the command: "--delete-merged" actually deletes branches whose tip > > is reachable from their upstream (when that upstream matches the given > > pattern). So, phooey. In this case, if "topic@{upstream}" was > > "origin/master", though, "--delete-merged=origin/*" would work, no? > > Incidentally, I find it a shame that GitHub's documentation encourages > > a triangular workflow (whether or not there is a fork remote involved) > > without talking about how to configure Git to help you: fork or not, > > if you push to a topic branch but merge to another, it's extremely > > handy to use push.default=current or some variant so that > > > > - @{upstream} is the place you'll merge > > - @{push} is the place you push > > > > and suddenly "git pull [--rebase]" does the right thing, "git status" > > (esp. with the new "status.compareBranches") can tell you where you > > are relative to both places of interest, etc. > > > > IOW, "git push -u origin topic" makes upstream configuration very odd > > in the GitHub-ish workflow! > > Fully agree! > > I would say most workflows are triangular on the underlying level, > even if the developer is not aware of it. If you work with GitHub PRs > or GitLab's MR, then you are engaging in a triangular workflow. > > I picked up some important tricks for visualizing the triangular on > this mailing list. But most of our users are not on the mailing list. Yep. Maybe I'll start writing a "triangular workflow" document à la Julia's work… going on the todo list, at any rate. > But what we can and should do is to make git itself clearer, so they > have a chance of intuiting it. I think for example that > > push.default=current > > should likely be the default. IIUC, the last change in this area was controversial. I worry that changes here now would have to get through "scar tissue" (both of Git contributors *and* users). At any rate, it would probably want to be a major version release, and I understand it's probably too late to discuss flipping that in 3.0? > And many people would have a better time with > > branch.autosetupmerge=inherit > > which gives you upstream/master as @{u} from the beginning, and then > you likely never abandon that if you are a regular GitHub user. Hm. Since I mostly do git switch -c topic origin or similar, I'm ok with the default (=true). With inherit, the primary help is to folks who do git switch -c topic main or something, right? But the documentation doesn't say what happens when inherit is used with a remote-tracking branch as a starting point (which has no upstream to copy from). > This is also why I feel strongly about this as default > (https://lore.kernel.org/git/pull.2458.git.git.1792437798463.gitgitgadget@gmail.com/): > > status.comparebranches=@{upstream} @{push} > > because it's confusing to switch tracking away from your "own branch" > to upstream/master, if that means losing the waypoint of how things > compare against @{push}. Yeah, I'll try and reply in that thread shortly. -- D. Ben Knoble