Skip to content

fix(cursor-team-kit): diff review-and-ship against the real base branch - #888

Open
rudycelekli wants to merge 1 commit into
cursor:mainfrom
rudycelekli:fix/review-and-ship-base-branch-20261025
Open

rudycelekli wants to merge 1 commit into
cursor:mainfrom
rudycelekli:fix/review-and-ship-base-branch-20261025

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

The Suggested Checks block in review-and-ship hardcodes the base: git fetch origin main followed by git diff origin/main...HEAD. The workflow step above it says to diff against the base branch, but the commands only work when that base is called main. In a repo whose default branch is master or something else, the first command fails with fatal: couldn't find remote ref main and the diff fails with ambiguous argument 'origin/main...HEAD', so the review starts with no diff. For a stacked PR whose base is another feature branch, the commands run without error but the diff includes every commit from the parent PR, and the review covers code the PR does not change.

I reproduced the failure with a shallow clone of tj/commander.js, whose default branch is master. I made one commit on a feature branch and ran the block's git commands as written. git fetch origin main exited 128 with couldn't find remote ref main, and git diff origin/main...HEAD exited 128. I then ran the new block in the same clone. BASE resolved to master through gh repo view, because the branch has no PR, and the fetch and diff ran and showed the one-line change. In a cursor/plugins worktree on the head branch of #887, the same first line resolved BASE to main from the PR's baseRefName.

The block now sets BASE from the current PR's baseRefName. If the branch has no PR, it falls back to the repo's default branch and uses origin/$BASE for both the fetch and the three-dot diff. This is the same choice #574 made for pstack's worktree-audit. node scripts/validate-plugins.mjs, node scripts/generate-pstack-harness-trees.mjs --check, and git diff --check pass.


Note

Low Risk
Documentation-only change to a skill’s suggested shell commands; no runtime or production code paths.

Overview
Updates the review-and-ship skill’s Suggested Checks so the review diff targets the correct base instead of always using main.

The bash snippet now sets BASE from the open PR’s baseRefName via gh pr view, or falls back to the repo default branch when there is no PR. git fetch and git diff use origin/$BASE so reviews work on repos whose default is not main and on stacked PRs whose base is another feature branch.

Reviewed by Cursor Bugbot for commit 5887d05. Bugbot is set up for automated code reviews on this repo. Configure here.

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