feat: allow :Greview to review explicit base/head refs #213
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/diffs.nvim#213
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Prerequisites
Problem
:Greview [base]is currently anchored to the state of the repository/worktree atrepo_root, not to an explicit review pair.The docs describe it as reviewing the repository against
[base], and the current implementation ofrequire('diffs.commands').greview(base, opts)shells out to:That means it can review:
repo_rootpoints somewhere elseBut it cannot directly review an arbitrary PR/ref pair like:
origin/main...refs/forge/pr/42base=<base>, head=<head>without first materializing the head in a checkout/worktree.
This makes integrations with PR-oriented tools awkward, because tools like Forge can already resolve a PR to explicit base/head refs and would ideally open
Greviewwithout mutating the user workspace.Proposed solution
Add a way for
Greview/greview()to accept an explicit head ref in addition to the base.A few possible shapes:
Ex command
or
Lua API
or a backward-compatible extension like:
Semantically, I think the best default for PR review is merge-base behavior (
base...head), but even a raw explicit two-ref comparison would unlock the integration.This would let
diffs.nvimact as a true non-checkout PR review surface, similar to how users can open:DiffviewOpen origin/main...HEADor:CodeDiff origin/main...HEADin other plugins.Alternatives considered
Hidden temp worktree + existing
greview(base, { repo_root = temp_root })Keeping
Greviewstrictly worktree-anchored