Skip to content

Rewrite test-git-versions.sh in PHP and update the tested git versions - #251

Merged
lyrixx merged 1 commit into
mainfrom
worktree-test-git-versions-php
Sep 7, 2026
Merged

Rewrite test-git-versions.sh in PHP and update the tested git versions#251
lyrixx merged 1 commit into
mainfrom
worktree-test-git-versions-php

Conversation

@lyrixx

@lyrixx lyrixx commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Port test-git-versions.sh to test-git-versions.php, using Symfony Console and Process in the same style as tests/fixtures/generate-bundle.php, split into a build and a test command.
  • Update the curated version list, picked for how long and widely each shipped as the default git on a major distro rather than a spread across history: v1.7.1 (RHEL/CentOS 6), v1.8.3.1 (RHEL/CentOS 7), v2.17.1 (Ubuntu 18.04), v2.25.1 (20.04), v2.34.1 (22.04), v2.43.0 (24.04).
  • Build robustness fixes needed to actually compile these on a modern toolchain: force -std=gnu17 (GCC 15's C23 unreachable() macro collides with an identifier in git's own source), and skip imap-send/Python/Tcl-Tk extras (NO_OPENSSL, NO_PYTHON, NO_TCLTK) which aren't needed and don't build cleanly on old sources.
  • Run each version's tests with an isolated HOME/XDG_CONFIG_HOME so the developer's own ~/.gitconfig (e.g. merge.conflictstyle = zdiff3, unknown to git < 2.35) can't leak into the subprocess and cause spurious failures.
  • Updated the test-git-versions.sh reference in .github/CONTRIBUTING.md and gitignored /git-builds/.

Ran build then test end-to-end against all six versions locally. v2.17.1 through v2.43.0 pass cleanly. v1.7.1 and v1.8.3.1 currently fail — v1.7.1 doesn't support git config --local (added in 1.7.10) which gitlib's tests use, and both hit a DiffParser error on their diff header format. These look like genuine compatibility gaps surfaced by the tool rather than script bugs; left as-is for a separate discussion/fix.

Test plan

  • php test-git-versions.php build then php test-git-versions.php test run against all six curated versions
  • castor qa:cs:cs --dry-run clean on the new file

Port the git-version build/test tool to PHP with Symfony Console and
Process, matching the style of tests/fixtures/generate-bundle.php, and
split it into a "build" and a "test" command.

Update the curated version list to versions picked for how long and
widely each shipped as the default git on a major distro: v1.7.1
(RHEL/CentOS 6), v1.8.3.1 (RHEL/CentOS 7), v2.17.1 (Ubuntu 18.04),
v2.25.1 (20.04), v2.34.1 (22.04), v2.43.0 (24.04).
@lyrixx
lyrixx merged commit 36114f4 into main Sep 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant