merge_check: separate Git revisions from checkout paths (OLD-9973) #1226

Manually merged
github merged 1 commit from gh-pr/1226/head into gh-pr/1226/base 2026-11-26 09:43:39 +00:00
Owner

@⁠IlyassRS3 on GitHub · 2026-11-24 20:36 UTC · original
IlyassRS3:carry/old-9973-merge-check-rev-paths → main · +21 −6 · 2 files · 1 commits · merged 2026-11-25 02:35 UTC

What changed

Carries forward old-pr/9973 (draft #242, original commit by @⁠nandanp1) rebased cleanly onto current main (f35d045cc), preserving the original author commit and retaining OLD-10032's out.split("\n") line splitting in prior_merges.

  • scripts/merge_check.py: append -- after revision arguments in git log, git diff, and git show so working-tree files whose names collide with a branch name, commit/tree SHA, or <rev>:<path> spec do not trigger Git's ambiguous argument ... both revision and filename error.
  • tests/test_merge_check.py: extend run_check to accept main= and assert exit code != 2 before JSON parsing; add collision subtests for working-tree files matching main, the main commit SHA, the merged tree SHA, and (on POSIX) main:docs/notes.md; update the git show mock list for the trailing --.

Item ID

  • Coordination issue #14 item: OLD-9973 (carries forward old-pr/9973 / draft #242, #17)
  • Depends on: none

Verification

Tested on macOS 27.2.1 (Apple M5 arm64), Python 3.14, Git (no game files, no GPU, standard library only):

  • python3 -I tests/test_merge_check.py -v -> 24/24 OK
  • Revert-source mutation check (reverting scripts/merge_check.py to upstream/main while keeping tests/test_merge_check.py) -> FAILED (6 failures), hitting Git's fatal: ambiguous argument ...: both revision and filename on all 4 collision cases (main, commit SHA, tree SHA, main:docs/notes.md) and both show ... -- mock assertions; restoring the fix returns to 24/24 OK.
  • python3 -m compileall -q scripts/merge_check.py tests/test_merge_check.py -> OK
  • python3 -I scripts/check_no_game_data.py scripts/merge_check.py tests/test_merge_check.py -> OK
  • python3 -I tests/test_ci_registration.py -> 15/15 OK
  • python3 -I tests/test_text_write_line_endings.py -> 3/3 OK

Checklist

  • No game files, binaries, shaders, textures, audio, or logs quoting them
  • No keys, decryption, or online services
  • Claimed in the coordination issue (#14) before opening this PR
  • AI-assisted: yes (carried forward, audited, rebased, and regression-verified with AI assistance; original commit by @⁠nandanp1 preserved)
**@⁠IlyassRS3** on GitHub · 2026-11-24 20:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1226) `IlyassRS3:carry/old-9973-merge-check-rev-paths` → `main` · +21 −6 · 2 files · 1 commits · merged 2026-11-25 02:35 UTC ## What changed Carries forward `old-pr/9973` (draft #242, original commit by @⁠nandanp1) rebased cleanly onto current `main` (`f35d045cc`), preserving the original author commit and retaining `OLD-10032`'s `out.split("\n")` line splitting in `prior_merges`. - `scripts/merge_check.py`: append `--` after revision arguments in `git log`, `git diff`, and `git show` so working-tree files whose names collide with a branch name, commit/tree SHA, or `<rev>:<path>` spec do not trigger Git's `ambiguous argument ... both revision and filename` error. - `tests/test_merge_check.py`: extend `run_check` to accept `main=` and assert exit code != 2 before JSON parsing; add collision subtests for working-tree files matching `main`, the `main` commit SHA, the merged tree SHA, and (on POSIX) `main:docs/notes.md`; update the `git show` mock list for the trailing `--`. ## Item ID - Coordination issue #14 item: `OLD-9973` (carries forward `old-pr/9973` / draft #242, #17) - Depends on: none ## Verification Tested on macOS 27.2.1 (Apple M5 arm64), Python 3.14, Git (no game files, no GPU, standard library only): - `python3 -I tests/test_merge_check.py -v` -> **24/24 OK** - Revert-source mutation check (reverting `scripts/merge_check.py` to `upstream/main` while keeping `tests/test_merge_check.py`) -> **FAILED (6 failures)**, hitting Git's `fatal: ambiguous argument ...: both revision and filename` on all 4 collision cases (`main`, commit SHA, tree SHA, `main:docs/notes.md`) and both `show ... --` mock assertions; restoring the fix returns to 24/24 OK. - `python3 -m compileall -q scripts/merge_check.py tests/test_merge_check.py` -> OK - `python3 -I scripts/check_no_game_data.py scripts/merge_check.py tests/test_merge_check.py` -> OK - `python3 -I tests/test_ci_registration.py` -> **15/15 OK** - `python3 -I tests/test_text_write_line_endings.py` -> **3/3 OK** ## Checklist - [x] No game files, binaries, shaders, textures, audio, or logs quoting them - [x] No keys, decryption, or online services - [x] Claimed in the coordination issue (#14) before opening this PR - [x] AI-assisted: yes (carried forward, audited, rebased, and regression-verified with AI assistance; original commit by @⁠nandanp1 preserved)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:43:36 +00:00
github manually merged commit d603159109 into gh-pr/1226/base 2026-11-26 09:43:39 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-24 20:36 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-24 20:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1226#pullrequestreview-6046990206) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Author
Owner

@⁠xel1uz on GitHub · 2026-11-24 20:48 UTC · original · approved these changes

I reproduced the ambiguity on upstream main with the new regression test. A checkout file named main, a commit SHA, or a tree SHA triggered the Git error on Windows and Linux. On Linux, main:docs/notes.md did too. Adding the -- boundaries fixes all those cases and preserves the expected JSON result.

python -I -B tests/test_merge_check.py -v passed 24/24 on Windows and Ubuntu at d6031591. It also passed 24/24 on Ubuntu after a clean trial merge into 66d4f5aa. I verified the carry-forward source against draft #242. Synthetic Git repositories, CPU only. AI-assisted review.

**@⁠xel1uz** on GitHub · 2026-11-24 20:48 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1226#pullrequestreview-6047149602) · **approved these changes** I reproduced the ambiguity on upstream `main` with the new regression test. A checkout file named `main`, a commit SHA, or a tree SHA triggered the Git error on Windows and Linux. On Linux, `main:docs/notes.md` did too. Adding the `--` boundaries fixes all those cases and preserves the expected JSON result. `python -I -B tests/test_merge_check.py -v` passed 24/24 on Windows and Ubuntu at `d6031591`. It also passed 24/24 on Ubuntu after a clean trial merge into `66d4f5aa`. I verified the carry-forward source against draft #242. Synthetic Git repositories, CPU only. AI-assisted review.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 02:35 UTC · original

Merging.

Why merged: merge_check passes git arguments after a -- boundary, so a path or ref that starts with - can't be read as an option. xel1uz approved it.

Why it's good: Own tests: 24 passed.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main b4b7756e8. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 3ff2a2adc (after #984): no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-25 02:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1226#issuecomment-7150923672) Merging. **Why merged:** merge_check passes git arguments after a `--` boundary, so a path or ref that starts with `-` can't be read as an option. xel1uz approved it. **Why it's good:** Own tests: 24 passed. Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main b4b7756e8. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 3ff2a2adc (after #984): no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.