What commands/features are available in a given version of Git? # add commit init ... @features = Git::Features->commands_in( '1.5.0' ); # add commit init/outside_of_dir ... @features = Git::Features->features_in( '1.6.5' ); When did a specific feature become available? # 1.5.0.rc1 $version = Git::Features->minimum_version_with( 'init' ); # 1.6.5 $version = Git::Features->minimum_version_with( 'init/outside_of_dir' ); # 1.0.0 $version = Git::Features->minimum_version_with( 'tar-tree' ); When did a specific command/feature disappear? # 220.127.116.11 $version = Git::Features->maximum_version_with( 'tar-tree' ); Even getting the version number is not a simple `git version` with older git (luckily `git --version` always works): # 1.3.0.rc1 $version = Git::Features->minimum_version_with( 'version' );
The idea of this module is to provide something similar to Module::CoreList, but for Git features.
Some git commands have been discontinued, some have appeared at a certain version. Some git commands have acquired specific features over time (for example init and init-db).
This module is meant to help people writing git script (using any of the existing Perl git wrappers, or even git itself) figure out which is the minimum version of Git they need according to the commands and features they depend on.
Command names are the usual git command names. Features will probably be more "ad-hoc", but always prefixed with the command name, separated by a slash. The only feature that I have in mind for now is
init/outside_of_dir (see the above link).
My plan is to go as far as git version 1.0, possibly a few releases before.
I'm not entirely sure of the interface yet, and if I should support things like
removed_from like Module::CoreList does.