Skip to content

feat(review): pick a commit as the diff base (#709)#723

Merged
backnotprop merged 2 commits into
mainfrom
feat/709
May 13, 2026
Merged

feat(review): pick a commit as the diff base (#709)#723
backnotprop merged 2 commits into
mainfrom
feat/709

Conversation

@backnotprop
Copy link
Copy Markdown
Owner

Summary

  • Widens the base picker for branch and merge-base diff modes from "branch only" to any commit-ish. getGitContext now returns the last 20 commits on HEAD; the picker exposes them via a Branches / Commits tab strip and accepts SHAs or HEAD~N typed into the search box.
  • Backend is minimal because git diff already accepts any commit-ish on the left side — the change is mostly UI plus one shared helper (listRecentCommits) wired into getGitContext. Pi inherits the change automatically via vendor.sh.
  • Closes [FEATURE] allow selecting comparing against commit HASH for "commited changes" view #709.

Test plan

  • In a git repo with several branches and commits, run plannotator review, switch to Committed changes, click the base chip, confirm Branches/Commits tabs render.
  • In Branches tab, picking a branch still works (regression check).
  • In Commits tab, clicking a recent commit sets that SHA as the base; chip label shows short SHA; diff updates to that commit..HEAD.
  • Type a SHA prefix into the search box — auto-focuses Commits tab, shows matching commit; pressing Enter also accepts a not-listed prefix.
  • Switch worktrees while base is a SHA — diff stays consistent.
  • jj / p4 repos: picker still works, no Commits tab (gated to git).
  • bun test packages/shared/review-core.test.ts passes (covers listRecentCommits + getGitContext.recentCommits).

Widens the base picker for `branch` and `merge-base` diff modes from
"branch only" to any commit-ish. `getGitContext` now returns the last
20 commits on HEAD; the picker shows them in a new "Recent commits"
group, and SHA-like or HEAD~N queries get a "Use … as base" affordance
for manual entry. Backend changes are minimal because git diff already
accepts any commit-ish on the left side of the range.
Replaces the three-section list (Local / Remote / Recent commits) with
a Branches | Commits tab strip — commits were below a scroll wall in
repos with many branches. SHA-like and HEAD~N queries auto-focus the
Commits tab so manual entry stays one keystroke away.
@backnotprop backnotprop merged commit 6db7ca9 into main May 13, 2026
10 checks passed
@backnotprop backnotprop deleted the feat/709 branch May 13, 2026 14:09
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.

[FEATURE] allow selecting comparing against commit HASH for "commited changes" view

1 participant