Introducing Git::Version::Compare

As explained last week, I took all the Git version comparison code out of Git::Repository, and moved it into a new module: Git::Version::Compare.

The code is roughly three times faster than the previous implementation in Git::Repository. This is admittedly useless, given the number of times one does compare Git version in a typical program (hint: once, to ensure the current Git version has all the needed features). :-)

Last but not least, this module does not depend on any Git wrapper, so you can use it no matter your preferences in Perl Git wrappers

Next steps:

  • cut a new release, since there are cases where development versions such as v1.5.3.7-1198-g467f42c might be compared incorrectly (when the other version is very close)
  • fix the modules I wrote that had they own version comparison logic (Git::Repository and Test::Requires::Git)
  • publish Git::Version, which is a small class with overloaded text comparisons, so that one can use the usual eq, gt, etc on these objects.

Leave a comment

About BooK

user-pic Pink.