Skip to content

Test actual older Git for Windows source-reader fallback - #5358

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
mihir-s-05:codex/windows-installed-git
Oct 24, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
mihir-s-05:codex/windows-installed-git

Conversation

@mihir-s-05

Copy link
Copy Markdown
Contributor

Change and mathematical scope

Complete the actual older-Git-for-Windows handoff in Discussion #4681. Official MinGit 2.35.3.windows.1 really rejects git cat-file --batch -z with exit 129 and no stdout; the unchanged source reader falls back once and returns the exact objects. Git 2.47.1.windows.1 is the supported-protocol control.

Add four installed-Git tests and a source-pinned evidence/reproduction note. Git object trees represent literal LF/CR/CRLF names without creating forbidden Windows filenames. Coverage includes independent SHA-1/SHA-256 blob IDs, empty/large binary/Unicode payloads, duplicate reads, early closure, invalid requests, actual process/pipe cleanup and watchdog removal. The observer retains the real executable, arguments and pipes; on the unsupported binary, exact-byte tests wait for its real rejection before returning the handle to exercise closed stdin.

This is tooling compatibility evidence. Production code, frozen inputs and the selected frontier are unchanged.

Task and overlap

Validation

Windows 11 build 26300, CPython 3.12.0 x64, PYTHONUTF8=1; MinGit archive verified against the publisher's SHA256.

python -W error -B -m unittest discover -s tests -p 'test_research_git_*.py' -v
python -O -W error -B -m unittest discover -s tests -p 'test_research_git_*.py' -v

For each Windows Git version and each Python mode: 61 discovered, 53 passed and 8 skipped. The skips are six existing POSIX descendant tests and two existing physical CR/LF filename fixtures; all four new tests run on Windows. The old full suite preceded final failure-only test teardown cleanup; the final new module was rerun successfully normally and with -O. On WSL Ubuntu, Git 2.43.0 / Python 3.12.3, the final new module also passes all four tests in both modes.

Two disposable source mutations—disable fallback, or bypass literal CR/LF resolution—each make the new exact-object test fail. git diff --cached --check passed. Exact commands, timings, binary/source hashes and limitations are in the note.

The initial default-encoding broader Windows run had an existing Unicode diagnostic-spelling assertion failure; rejection still occurred. It is documented, not counted as a pass or fixed here. Direct-child stall tests use controlled Python subprocesses; native Windows descendant-held pipes are unverified. No selected cold replay, mathematical/proof-kernel verification or hosted-CI success is claimed by this local evidence.

Credit

Retain Nick Petalas (#2752), Mihir Srivastava (#4686), Brian / JoyboyBrian (#4738/#5185), Woklerx, Arham Tahir and Douglas Colkitt's reader/source-contract credit, and Tekalign's object-tree fixture lineage. Prepared for Mihir Srivastava with substantial OpenAI Codex assistance, one agent. Apache-2.0.

Open next questions

The evidence note leaves two separate, unclaimed follow-ups: a native Windows descendant-held-pipe ownership fixture (first prove readiness and survival after leader exit), and the existing Windows diagnostic-encoding assertion. Neither blocks this version-pair compatibility result.

@jwr404

jwr404 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Independent review (James Reed, with Claude Code). Head 0f184845dca823c5cb3fe3f13ef61fe977716d08.

Verdict: the new tests are portable and exercise both reader paths. No production code changes.

Checks on Linux, CPython 3.12, with this PR's tests/test_research_git_installed.py on canonical main:

  • Supported protocol (system Git 2.56.0). python3.12 -W error -B -m unittest discover -s tests -p 'test_research_git_*.py' runs 61 tests: OK. With -O, all 4 new installed-Git tests run (not skipped) and pass: SHA-1 and SHA-256 objects with literal LF/CR/CRLF names, early close, and missing-tree/NUL rejection.
  • Fallback path, emulated. I put a wrapper git first on PATH that mimics Git 2.35: cat-file … -z prints error: unknown switch 'z' and exits 129, and everything else is forwarded to the real Git. The probe returns exit 129 as on MinGit 2.35.3. The same 61-test discovery is OK, so the unchanged source reader's one-time fallback returns the exact objects. Your installed_protocol() probe selects the old-Git expectations, and the observer's wait-for-probe-exit path is exercised off Windows.

This doesn't replace your real MinGit 2.35.3 evidence, since a shell wrapper isn't the Windows binary and its pipe semantics. But it confirms the tests are not Windows-only in their logic, and that the fallback assertions hold under an independent rejection implementation. One suggestion: a GIT environment override, or a documented PATH shim like the one above, would let CI run the fallback branch on Linux every time.

@Mister-Meeseeks
Mister-Meeseeks merged commit e36f783 into CrocSwap:main Oct 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants