From: Harald Nordgren Date: Tue, 23 Dec 2025 11:36:02 GMT Subject: Re: [PATCH] status: show default branch comparison when tracking non-default branch Message-ID: <20251223113602.63000-1-haraldnordgren@gmail.com> In-Reply-To: <20251223102422.36853-1-haraldnordgren@gmail.com> (Adding another comment to my own thread to reply to Junio C Hamano) > branch..merge + branch..remote > that defines where you pull from is one thing to compare with. To > learn the other, the destination of a push of this branch, would > involve poking at remote.pushdefault, branch..pushRemote, > branch..remote to find out which remote repository it goes, > and then remote..push to find out where this branch goes, > but the helper functions to learn all that are already available. When a new branch is created it has no push settings: git checkout -b ahead_of_main_status__tmp2 git push fatal: The current branch ahead_of_main_status__tmp2 has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin ahead_of_main_status__tmp2 To have this happen automatically for branches without a tracking upstream, see 'push.autoSetupRemote' in 'git help config'. Once the users runs that suggested command git push --set-upstream origin ahead_of_main_status__tmp2 then the 'branch..merge' and 'branch..remote' no longer hold the reference to "upstream/HEAD". For sure, it would be great to re-use previous logic for this, but can it really be done without new logic? Harald