Skip to content

Record the PR base-oid trap in the stacked-worktree-prs skill - #213

Merged
gilesknap merged 1 commit into
mainfrom
skill/pr-base-oid
Aug 24, 2026
Merged

gilesknap merged 1 commit into
mainfrom
skill/pr-base-oid

Conversation

@gilesknap

Copy link
Copy Markdown
Member

One section, from a mistake made today.

Splitting settled work out of a long branch — branch at the last good commit,
PR it, merge it — does not shrink the PR that contained those commits. The
skill already covers retargeting a base ref name when a parent is merged; this
is the other half: the name already says main, while baseRefOid stays pinned
to the sha main had when the PR was opened, and GitHub does not advance it
because main moved.

Measured 2026-08-23: after #211 merged nine commits into main,
git log main..hotfix/easy-to-drive was the two remaining commits while
gh pr diff 208 --name-only still listed 29 files and baseRefOid still read
9f8abdb. I predicted it would clean itself up, which was wrong — hence the
section.

Also records the two choices that make such a split work at all, both of which
fail silently if got wrong:

  • --merge, never --squash — a squash creates a new sha with no shared
    history, so the base can never advance and the split achieves nothing.
  • A branch ref at an existing commit (git branch <name> <sha>) rather than
    a cherry-pick, whenever the settled work is a contiguous prefix. Cherry-picking
    rewrites shas and guarantees the same failure.

Docs only — no code, no tests affected.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17

Splitting settled work out of a long branch and merging it leaves the original
PR showing every one of those commits. The existing section covers retargeting
a base ref *name*; this is the other half - the name already says `main` while
`baseRefOid` stays pinned to the sha main had when the PR was opened, and
GitHub does not advance it just because main moved.

Measured 2026-08-23: after #211 merged nine commits into main, `git log
main..hotfix/easy-to-drive` was two commits while `gh pr diff 208` still listed
29 files and baseRefOid still read 9f8abdb. I told Giles it would clean itself
up, which was wrong, and the fix is to read the oid rather than the ref name.

Also records the two choices that make the split work at all: `--merge` rather
than `--squash`, since a squash shares no history and the base can never
advance, and a branch ref at an existing commit rather than a cherry-pick,
which rewrites shas and guarantees the same failure.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FYtMwgNNTe2jB2ZLh2nx17
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: da0c4be0-7876-4d41-b54f-3b57543c97fc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gilesknap
gilesknap merged commit 21960c7 into main Aug 24, 2026
30 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