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

Merged
IlyassRS3 merged 1 commit from upstream-pr/1226 into main 2026-11-25 02:35:37 +00:00
IlyassRS3 commented 2026-11-24 20:36:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by IlyassRS3 on 2026-11-24T20:36:40Z.


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)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5479915698 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1226). Originally posted by [IlyassRS3](https://github.com/IlyassRS3) on 2026-11-24T20:36:40Z. --- ## 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)
copilot-pull-request-reviewer[bot] commented 2026-11-24 20:36:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T20:36:48Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6046990206 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1226#pullrequestreview-6046990206). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-24T20:36:48Z. **Review:** COMMENTED --- 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.
xel1uz commented 2026-11-24 20:48:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by xel1uz on 2026-11-24T20:48:15Z.

Review: APPROVED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6047149602 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1226#pullrequestreview-6047149602). Originally posted by [xel1uz](https://github.com/xel1uz) on 2026-11-24T20:48:15Z. **Review:** APPROVED --- 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.
QemmHD commented 2026-11-25 02:35:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-25T02:35:34Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7150923672 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1226#issuecomment-7150923672). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-25T02:35:34Z. --- 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).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1226
No description provided.