[doc] Fix no-new-rst lint check crashing on stacked PRs#64249
Open
elliot-barn wants to merge 1 commit into
Open
[doc] Fix no-new-rst lint check crashing on stacked PRs#64249elliot-barn wants to merge 1 commit into
elliot-barn wants to merge 1 commit into
Conversation
The doc_no_new_rst check (doc/test_no_new_rst.py) fetches the base branch with `git fetch origin <base>` and then diffs against `origin/<base>`. `git fetch` populates FETCH_HEAD but does not create a remote-tracking ref for an arbitrary branch, so `origin/<base>` only resolves for branches already present in the clone (e.g. master). For PRs whose base is another feature branch (stacked PRs), `origin/<base>` is absent and the diff aborts with `fatal: bad revision` (git exit 128), failing the check before it ever evaluates whether any .rst files were added. Diff against FETCH_HEAD -- which the preceding fetch always populates with the base tip -- instead. Behavior is unchanged for master-based PRs and the check is fixed for stacked PRs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the git diff command in doc/test_no_new_rst.py to compare against FETCH_HEAD instead of {remote}/{base}. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
edoakes
approved these changes
Jun 22, 2026
dstrodtman
approved these changes
Jun 22, 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.
Why are these changes needed?
The
doc_no_new_rstlint check (doc/test_no_new_rst.py) fetches the base branch withgit fetch origin <base>and then diffs againstorigin/<base>:git fetch origin <base>populatesFETCH_HEADbut does not create a remote-tracking refrefs/remotes/origin/<base>. Soorigin/<base>only resolves for branches already present in the clone (e.g.master). For PRs whose base is another feature branch (stacked PRs),origin/<base>is absent and the diff aborts withfatal: bad revision(git exit 128) — failing the check before it ever evaluates whether any.rstfiles were added.This fix diffs against
FETCH_HEAD— which the precedinggit fetchalways populates with the base tip — instead oforigin/<base>. Behavior is unchanged formaster-based PRs (the common case); the check is fixed for stacked PRs.The change is pure git mechanics with no behavioral change to what the check enforces (still flags newly-added
.rstfiles underdoc/source/).Related issue number
N/A
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.