Skip to content

status: count push divergence outside the upstream - #2437

Draft
HaraldNordgren wants to merge 1 commit into
git:masterfrom
HaraldNordgren:status-push-not-in-upstream
Draft

HaraldNordgren wants to merge 1 commit into
git:masterfrom
HaraldNordgren:status-push-not-in-upstream

Conversation

@HaraldNordgren

@HaraldNordgren HaraldNordgren commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

After rebasing onto a newer upstream, the @{push} comparison from status.compareBranches counts every new upstream commit as yours. This keeps the full counts and adds how many are not in @{upstream}:

Your branch and 'origin/topic' have diverged,
and have 51 and 1 different commits each (1 and 1 not in 'upstream/main').

When those commits carry the same changes on both sides, it says so:

Your branch and 'origin/topic' have diverged,
and have 51 and 1 different commits each (rebased cleanly on 'upstream/main').

@HaraldNordgren
HaraldNordgren force-pushed the status-push-not-in-upstream branch from 64c49c9 to f29a690 Compare October 2, 2026 18:44
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
HaraldNordgren force-pushed the status-push-not-in-upstream branch from f29a690 to 419cf73 Compare October 2, 2026 19:15

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant