[PR #1226] [MERGED] merge_check: separate Git revisions from checkout paths (OLD-9973) #1258

Closed
opened 2026-11-26 20:20:37 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1226
Author: @IlyassRS3
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @QemmHD

Base: main ← Head: carry/old-9973-merge-check-rev-paths


📝 Commits (1)

  • d603159 merge_check: separate Git revisions from checkout paths

📊 Changes

2 files changed (+21 additions, -6 deletions)

View changed files

📝 scripts/merge_check.py (+3 -3)
📝 tests/test_merge_check.py (+18 -3)

📄 Description

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)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1226 **Author:** [@IlyassRS3](https://github.com/IlyassRS3) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `carry/old-9973-merge-check-rev-paths` --- ### 📝 Commits (1) - [`d603159`](https://github.com/ubiquitarianism/leonida/commit/d6031591098839381596e391aa93f36aaaa0fd9d) merge_check: separate Git revisions from checkout paths ### 📊 Changes **2 files changed** (+21 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `scripts/merge_check.py` (+3 -3) 📝 `tests/test_merge_check.py` (+18 -3) </details> ### 📄 Description ## 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:37 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1258
No description provided.