Skip to content

fix: compare branches against nearest default baseline - #82

Merged
flexdinesh merged 1 commit into
mainfrom
fix/nearest-default-baseline
Oct 21, 2026
Merged

flexdinesh merged 1 commit into
mainfrom
fix/nearest-default-baseline

Conversation

@flexdinesh

Copy link
Copy Markdown
Owner
  • diffsource.DefaultBaselines replaces DefaultBranch: returns local default ref plus remote-tracking counterpart (local default's upstream under refs/remotes/, else origin/<default>). Never reads the feature branch's upstream; never fetches.
  • nearestBaseline in auto OpenComparison: uses remote merge base only when it strictly descends from local; ties/divergence keep local; unrelated histories skipped. Fixes branches cut from a fresher origin/main showing upstream commits as branch changes, without leaking unpushed local-main commits or regressing on stale remotes.
  • Missing local default with existing remote-tracking ref now compares against remote instead of HEAD fallback.
  • Recorded baseRef may be refs/remotes/...; verifyComparison re-checks it (409 on move). UI already strips refs/remotes/.
  • Docs: docs/plugins.md, README.md describe the nearest-baseline rule.
  • Validation: new comparison_test.go cases; mise run check passes; process-mode repro (local main=A, origin/main=A→B, feature from origin/main) records refs/remotes/origin/main at B.

Auto mode merge-based against local default only, so branches cut from a
fresher origin/main included upstream commits. Pick the nearer of local and
remote-tracking default merge bases; ties and divergence keep local.
@flexdinesh
flexdinesh enabled auto-merge (squash) October 21, 2026 07:06
@flexdinesh
flexdinesh merged commit 4e0b84a into main Oct 21, 2026
2 checks passed
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