tests: skip merge_check cases on a git without merge-tree --write-tree (TEST-MERGE-CHECK-OLD-GIT) #1248

Open
github-bot wants to merge 1 commit from github-bot/gh-1248 into main AGit
Owner

@⁠TheGeogeo on GitHub · 2026-11-24 20:49 UTC · original
TheGeogeo:test/merge-check-old-git → main · +24 −0 · 1 files · 1 commits · open

Claimed in the coordination issue as: TEST-MERGE-CHECK-OLD-GIT — #14

What and why

scripts/merge_check.py documents git 2.38 or newer for merge-tree --write-tree, but its test does not check for it. On an older git, 18 of the 24 tests fail with JSONDecodeError or a wrong message, which reads as a broken tool. Those 18 tests now skip with the reason when git merge-tree -h does not offer --write-tree. The other six keep running, and nothing is skipped on a git that has the option.

Tested

On Windows 11, Python 3.12.4, on main at 66d4f5aa (6a4500d8):

  • git 2.36.0.windows.1: python -I -B tests/test_merge_check.py gave 17 errors and 2 subtest failures before (measured on 2e026b03). Now 24 run, 18 skipped, OK.
  • git 2.56.1.windows.1: 24 run, none skipped, OK.
  • Negative control on git 2.56.1 (before this rebase, same patch): with the tool's --write-tree replaced by an unknown option, the suite still fails (17 errors, 2 subtest failures) instead of skipping.
  • The probe gives the same answer outside a repository.
  • Merge with #1226 (d6031591), which edits the same file (before this rebase, same patch): no conflict; 18 skipped on git 2.36.0, 24 OK on git 2.56.1.
  • test_tool_stdout_encoding.py, test_text_write_line_endings.py, test_docs_links.py, test_docs_cli_flags.py, compileall, git diff --check and the no-game-data check passed (before this rebase, same patch).

GPUs tested: n/a (CPU-only synthetic tests).

AI-assisted: yes (Claude Code).

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
**@⁠TheGeogeo** on GitHub · 2026-11-24 20:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1248) `TheGeogeo:test/merge-check-old-git` → `main` · +24 −0 · 1 files · 1 commits · open Claimed in the coordination issue as: TEST-MERGE-CHECK-OLD-GIT — https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 ### What and why `scripts/merge_check.py` documents git 2.38 or newer for `merge-tree --write-tree`, but its test does not check for it. On an older git, 18 of the 24 tests fail with `JSONDecodeError` or a wrong message, which reads as a broken tool. Those 18 tests now skip with the reason when `git merge-tree -h` does not offer `--write-tree`. The other six keep running, and nothing is skipped on a git that has the option. ### Tested On Windows 11, Python 3.12.4, on `main` at `66d4f5aa` (`6a4500d8`): - git 2.36.0.windows.1: `python -I -B tests/test_merge_check.py` gave 17 errors and 2 subtest failures before (measured on `2e026b03`). Now 24 run, 18 skipped, OK. - git 2.56.1.windows.1: 24 run, none skipped, OK. - Negative control on git 2.56.1 (before this rebase, same patch): with the tool's `--write-tree` replaced by an unknown option, the suite still fails (17 errors, 2 subtest failures) instead of skipping. - The probe gives the same answer outside a repository. - Merge with #1226 (`d6031591`), which edits the same file (before this rebase, same patch): no conflict; 18 skipped on git 2.36.0, 24 OK on git 2.56.1. - `test_tool_stdout_encoding.py`, `test_text_write_line_endings.py`, `test_docs_links.py`, `test_docs_cli_flags.py`, `compileall`, `git diff --check` and the no-game-data check passed (before this rebase, same patch). GPUs tested: n/a (CPU-only synthetic tests). AI-assisted: yes (Claude Code). ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption.
scripts/merge_check.py needs git 2.38 or newer. On an older git the suite failed with JSON decoding errors instead of saying so.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:44:24 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 14:35 UTC · original

Reviewed 6a4500d88: ran tests/test_merge_check.py on the PR tree (24 tests, OK, nothing skipped, git 2.47) and against a shim that fakes a pre-2.38 git: the conflict-free merge with current main then skips exactly the 18 merge-tree tests instead of failing, while on main today those 18 still fail under the same shim. The six tests left unguarded never call merge-tree. AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 14:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1248#issuecomment-7165526012) Reviewed 6a4500d88: ran tests/test_merge_check.py on the PR tree (24 tests, OK, nothing skipped, git 2.47) and against a shim that fakes a pre-2.38 git: the conflict-free merge with current main then skips exactly the 18 merge-tree tests instead of failing, while on main today those 18 still fail under the same shim. The six tests left unguarded never call merge-tree. AI-assisted review. **Recommendation:** Merge
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1248/head:github-bot/gh-1248'
git switch 'github-bot/gh-1248'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1248'
git switch 'github-bot/gh-1248'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1248'
git switch 'github-bot/gh-1248'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1248'
git switch 'main'
git merge --squash 'github-bot/gh-1248'
git switch 'main'
git merge --ff-only 'github-bot/gh-1248'
git switch 'main'
git merge 'github-bot/gh-1248'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.