Improve push-reference-docs skill: handle diverged docs branches on retarget#48545
Merged
noahtalerman merged 2 commits intoJul 1, 2026
Merged
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
noahtalerman
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: NA
What & why
The
push-reference-docsskill's OPEN-PR path told the operator to retarget the PR's base from the source docs branch to the target docs branch as an unconditional one-liner. That is only safe when the source branch is an ancestor of the target.Release docs branches (e.g.
docs-v4.89.0anddocs-v4.90.0) routinely diverge onto separate lines from an older common ancestor. Since a GitHub PR diff ismerge-base(HEAD, base)...HEAD, retargeting to a diverged branch moves the merge-base back to that old ancestor and silently pulls every source-only commit into the PR diff — files the author never touched. This happened in practice and required a manual rebase to clean up.Changes
Rewrote the OPEN-PR path into a 7-step procedure:
git merge-base --is-ancestor <source> <target>:CONTAINED→ plain retarget is safe (previous behavior).DIVERGED→ rebase the branch onto the target first.git rebase --onto <target> <fork-point>to replay only the PR's own commits.--force-with-lease), with a fallback to hand the push to the user if a permission rule blocks it.merge-base(HEAD, base)...HEADmechanism so the next operator understands the why.Docs-tooling change only — no product code, no user-facing behavior, no tests/migrations.