status: count push divergence outside the upstream - #2437
Draft
HaraldNordgren wants to merge 1 commit into
Draft
HaraldNordgren wants to merge 1 commit into
HaraldNordgren wants to merge 1 commit into
Conversation
HaraldNordgren
force-pushed
the
status-push-not-in-upstream
branch
from
October 2, 2026 18:44
64c49c9 to
f29a690
Compare
After rebasing onto a newer upstream, "git status" counts every commit
the upstream gained since the last push as a difference from the push
branch when status.compareBranches includes "@{push}". That can be many
commits, even when only a few of your own differ.
Keep the full counts, and when they include commits from the upstream,
add how many of them are not in it:
Your branch and 'origin/topic' have diverged,
and have 51 and 1 different commits each (1 and 1 not in 'upstream/main').
When the commits outside the upstream carry the same changes on both
sides, say so:
Your branch and 'origin/topic' have diverged,
and have 51 and 1 different commits each (rebased cleanly on 'upstream/main').
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
HaraldNordgren
force-pushed
the
status-push-not-in-upstream
branch
from
October 2, 2026 19:15
f29a690 to
419cf73
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After rebasing onto a newer upstream, the
@{push}comparison fromstatus.compareBranchescounts every new upstream commit as yours. This keeps the full counts and adds how many are not in@{upstream}:When those commits carry the same changes on both sides, it says so: