Skip to content

feature: add Compare with default base on current branch menu#2322

Open
ivnnv wants to merge 1 commit intosourcegit-scm:developfrom
ivnnv:pr/branch-diff
Open

feature: add Compare with default base on current branch menu#2322
ivnnv wants to merge 1 commit intosourcegit-scm:developfrom
ivnnv:pr/branch-diff

Conversation

@ivnnv
Copy link
Copy Markdown

@ivnnv ivnnv commented May 5, 2026

Other local branches in the sidebar already have a one-click "Compare with HEAD" entry, but the current branch's right-click only offers the free-form "Compare with..." palette. Adds a "Compare with <default>" entry that opens the existing Compare window pre-filled with the repo's default base branch.

Screenshot 2026-05-05 at 17 51 04

The default branch is resolved from refs/remotes/<remote>/HEAD (the same source GitHub/GitLab use), with the remote chosen via the same fallback order used elsewhere in the app: current branch's upstream remote → Settings.DefaultRemote → first remote. The entry is hidden when the remote HEAD is unset or when the resolved base equals the current branch (so it never shows "Compare master with master").

Test plan

  • Right-click the current branch and confirm "Compare with <default>" appears, opens the existing Compare window pre-filled.

Other local branches in the sidebar already have a one-click Compare
with HEAD entry, but the current branch's right-click only offers the
free-form Compare with... palette. Adds a Compare with <default> entry
that opens the existing Compare window pre-filled with the repo's
default base branch (resolved via refs/remotes/<remote>/HEAD).

The remote selection follows the same policy used elsewhere
(current branch's upstream remote -> Settings.DefaultRemote ->
first remote). The entry is hidden when the remote HEAD is unset
or when the resolved base equals the current branch.

Adds Commands/QueryDefaultBranch (one symbolic-ref call) and a
small resolver in BranchTree.axaml.cs. No changes to Compare,
CompareRevisions, or DiffOption.
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