Test your Git wrapper against 500 versions of Git

Ever since I wrote Git::Repository, I've paid attention to supporting as many Git versions as possible.

This is possible because it is a really thin wrapper around Git, that expects only a few sub-commands to exist. Therefore the burden of making sure the Git they're using supports all the features they need is put on the user (the various version comparison methods are meant help working that out).

Looking at the Changes file, we can see I've paying attention to older Git for a long time (the distribution was first published in June 2010):

  • Version 1.13 (October 2010) was tested against 120+ versions of git, including all versions of the 1.6.* and 1.7.* branches up until 1.7.3.1.
  • No bragging about Git coverage in 2011-2012
  • Version 1.304 (May 2013) has been tested against 326 versions of git (including all RC), from 1.5.0.rc0 to 1.8.3.rc3
  • Version 1.310 (January 2014) has been tested against 350 versions of git (including all RC), from 1.5.0.rc0 to 1.8.5.3
  • No bragging about Git coverage in 2015
  • Version 1.317 (February 2016) has been tested against 513 versions of git (including the 190 RC), from 1.0.0 to 2.7.1

Until now, my collection of Git has been managed with a crude shell script that simply ran make install with the right prefix (Git is very easy to compile and install). And another that loops the first against the output of git tag -l 'v*'. And the test script was a Perl script running prove in a loop again.

For this release of Git::Repository, I decided to include a test script that runs the test suite against all versions of Git installed in a specific directory. It was also a good time to write a script dedicated to building Git, since for building older Git some additional patches might be required (and the script takes care of that).

Building all versions (including 190 RC) of Git from 1.0.0 to 2.7.1 took 5ΒΌ hours on my fairly old system, and the 513 installs take up 22.6 gigabytes of disk.

So if you want to test your Git wrapper against all possible Git (if only to determine the minimum supported version), you're welcome to use the eg/build-git program, and the t/test-all-git.t test script (this one uses Git::Repository for version comparison, but that can be easily removed).

If you're the author of a Git wrapper, I'll probably send you a report myself. ;-)

Next, I'll be taking the version comparison code out of Git::Repository, and release Git::VersionCompare (or Git::CompareVersions, I'm not decided yet), which will not depend on Git::Repository. I

Leave a comment

About BooK

user-pic Pink.