From ef5ddf24e5103349b6c78ca30a00d2f80c44aa60 Mon Sep 17 00:00:00 2001 From: elliot-barn Date: Mon, 22 Jun 2026 03:22:07 +0000 Subject: [PATCH] [doc] Fix no-new-rst lint check crashing on stacked PRs The doc_no_new_rst check (doc/test_no_new_rst.py) fetches the base branch with `git fetch origin ` and then diffs against `origin/`. `git fetch` populates FETCH_HEAD but does not create a remote-tracking ref for an arbitrary branch, so `origin/` only resolves for branches already present in the clone (e.g. master). For PRs whose base is another feature branch (stacked PRs), `origin/` 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) Signed-off-by: elliot-barn --- doc/test_no_new_rst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/test_no_new_rst.py b/doc/test_no_new_rst.py index 1f830340bc1b..68077206723b 100644 --- a/doc/test_no_new_rst.py +++ b/doc/test_no_new_rst.py @@ -26,7 +26,7 @@ def _list_added_files(base: str, commit: str, remote: str = "origin") -> List[st "diff", "--name-only", "--diff-filter=A", - f"{remote}/{base}...{commit}", + f"FETCH_HEAD...{commit}", "--", ], text=True,