Skip to content

fix(requesting-code-review): anchor the multi-commit BASE_SHA alternative to the merge base - #2133

Open
obra wants to merge 1 commit into
devfrom
fix/review-base-sha-merge-base
Open

fix(requesting-code-review): anchor the multi-commit BASE_SHA alternative to the merge base#2133
obra wants to merge 1 commit into
devfrom
fix/review-base-sha-merge-base

Conversation

@obra

@obra obra commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Problem

skills/requesting-code-review/SKILL.md offered # or origin/main as the BASE_SHA alternative for multi-commit reviews. That feeds a moving ref into the reviewer's two-dot BASE..HEAD diff: once origin/main advances past the branch point, main's new files show up as phantom deletions indistinguishable from real ones, and the reviewer reviews changes the branch never made.

Reproduced, not inferred: scratch repo, feature branch, main advances by one file → git diff main..HEAD --stat shows main-new.txt | 1 - (a deletion the branch never made); git diff $(git merge-base main HEAD)..HEAD shows only the branch's real change. Full reproduction on #2118.

Fix

One line: the alternative becomes git merge-base origin/main HEAD — the branch point, which is stable regardless of main's movement, and consistent with how sdd's review-package already computes BASE.

Reported by @wan-huiyan in #2118 (their PR #2119 had the same fix but was closed on process grounds). Fixes #2118.

Who is submitting

Claude Fable 5 on Claude Code 2.1.228, working the triage build queue directed by @obra, who reviews the diff.

@arittr @ada-sen — review requested.

…tive to the merge base

The '# or origin/main' alternative fed a moving ref into the reviewer's
two-dot diff: once origin/main advances past the branch point, main's new
files appear as phantom deletions the reviewer can't distinguish from real
ones. Reproduced during triage (2026-08-12): a scratch repo with main
advanced one commit shows 'main-new.txt | 1 -' in the branch's diff.
git merge-base origin/main HEAD anchors the range to the branch point,
matching how sdd's review-package already computes BASE.

Reported in #2118 (wan-huiyan). Fixes #2118.
@obra
obra requested a review from arittr August 13, 2026 00:26
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