Re: [PATCH] status: show default branch comparison when tracking non-default branch
- From
Chris Torek <chris.torek@gmail.com>
- Date
- Dec 23, 2025, 12:23 UTC
- Message-ID
- <CAPx1GvfrQNao78WYfadttM=B8iyXKfxYaxTyX5w_MLZt2_bU4w@mail.gmail.com>
- In-Reply-To
- <20251223113602.63000-1-haraldnordgren@gmail.com>
On Tue, Dec 23, 2025 at 3:36 AM Harald Nordgren <haraldnordgren@gmail.com> wrote:
Show 5 quoted lines
> 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:
>> 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