Re: [PATCH] status: show default branch comparison when tracking non-default branch
From: Chris Torek <hidden>
Date: 2025-12-23 12:23:52
On Tue, Dec 23, 2025 at 3:36 AM Harald Nordgren [off-list ref] wrote:
Once the users runs that suggested command
git push --set-upstream origin ahead_of_main_status__tmp2
then the 'branch.<name>.merge' and 'branch.<name>.remote' no longer hold the reference to "upstream/HEAD".Right. And, as Junio noted, to:
quoted
learn the other, the destination of a push of this branch, would involve poking at remote.pushdefault, branch.<name>.pushRemote, branch.<name>.remote to find out which remote repository it goes, and then remote.<remote>.push to find out where this branch goes,
That is, there are some separate configuration items that can change where `git push` goes. Using `git push --set-upstream` sets ones that affect `git pull`, `git status`, and `git push`, but it's possible to set ones that affect only `git push`. That still leaves `git status` with the problem you (Harald) have observed, so perhaps the path forward is to have `git status` check things like branch.<name>.pushRemote to see if they exist and differ from branch.<name>.remote. Chris