Another look?
From: Harald Nordgren <hidden>
Date: 2026-01-02 20:27:41
Looking at the tests, it seems that the extra information is shown whenever the upstream branch differs from the default push destination even if they are on the same remote. I think that is sensible but this paragraph should be updated to reflect the fact that one does not need to set either of the "pushDefault" config settings to benefit from this.
Good catch, will be included in the next diff!
I'm wondering why we don't reuse the existing messages - I don't see how using a different wording for the push destination compared to the upstream branch benefits the user. We should adjust the hints that are shown so that we only recommend pulling from the upstream branch and only recommend pushing to the default push destination but the comparisons should be the same. Also I don't find the message "Diverged from 'origin/feature' by N commits' very helpful, I'd find it more useful if it gave the ahead/behind count like we do for the upstream branch.
Thanks for saying this, I actually did the majority of this work already but was hesitant to include it in the diff because it increases the surface area. But I will include it now!
Shouldn't we be taking account of the push and fetch refspecs here? There
is no guarantee that $branch maps to refs/remotes/$remote/$branch. To take
a silly example, if we have
remote.$remote.fetch =
refs/heads/$branch:refs/remotes/$remote/abc-$branch remote.$remote.pull =
refs/heads/$branch:refs/heads/xyz-$branch
Then we should be using "refs/remotes/$remote/abc-xyz-$branch" in the
message above as "$branch" will be pushed to "xyz-$branch" on the remote
which is fetched to "$remote/abc-xyz-$branch"I don't understand this one, can you maybe explain how to code will need to change?
As we don't use flag we can pass NULL - see the documentation for this function in refs.h
Thanks, will be included in the next diff!
Why are we still suggesting pushing to the upstream branch when we know
the user is pushing to a different remote branch? Thanks, will be included in the next diff! Harald