Skip to content

Show ahead/behind commit counts in Source Control header #25

@Ron537

Description

@Ron537

Summary

Show ahead/behind commit counts vs the upstream branch in the Source Control view header (e.g. ↑3 ↓1 next to the project name).

Acceptance criteria

  • Repo status returned by getRepoStatus() already includes the data needed (or extend it to do so) — see src/preload/index.ts RepoStatus type.
  • Render an ↑N ↓N pill in the GitSidePanelView header next to the branch name when both are nonzero.
  • Hide the pill when both are 0 (clean state).
  • Hover tooltip explaining "N commits ahead of / behind upstream".

Files to touch

  • src/main/services/<repo-status-service>.ts (extend to compute ahead/behind via git rev-list --left-right --count <upstream>...HEAD)
  • src/preload/index.ts (add fields to RepoStatus)
  • src/renderer/src/components/git/GitSidePanelView.tsx (render pill)

How to test

  • Set up a project where upstream has 1 extra commit and you have 2 local commits → expect ↑2 ↓1.
  • A clean repo → no pill shown.
  • A repo with no upstream → no pill, no error.

Effort: 4-6 hours.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions