NAME

Git::Wrapper::Plus::Support - Determine what versions of things support what

VERSION

version 0.003101

SYNOPSIS

use Git::Wrapper::Plus::Support;

my $support = Git::Wrapper::Plus::Support->new(
    git => <git::wrapper>
);
if ( $support->supports_command( 'for-each-ref' ) ) {

}
if ( $support->supports_behavior('add-updates-index') ) {

}

METHODS

supports_command

Determines if a given command is supported on the current git.

This works by using a hand-coded table for interesting values by processing git log for git itself.

Returns undef if the status of a command is unknown ( that is, has not been added to the map yet ), 0 if it is not supported, and 1 if it is.

if ( $supporter->supports_command('for-each-ref') ) ) {
    ...
} else {
    ...
}

Currently indexed commands

for-each-ref init init-db update-cache update-index ls-remote cat-file show-diff write-tree commit-tree

supports_behavior

Indicates if a given command behaves in a certain way

This works by using a hand-coded table for interesting values by processing git log for git itself.

Returns undef if the status of a commands behavior is unknown ( that is, has not been added to the map yet ), 0 if it is not supported, and 1 if it is.

if ( $supporter->supports_behavior('add-updates-index') ) ) {
    ...
} else {
    ...
}

Current behaviors

add-updates-index

Older versions of git required you to do:

git update-index $FILE

Instead of

git add $FILE

To update content.

can-checkout-detached

Not all versions of Git can checkout a detached head.

2-arg-cat-file

The syntax:

git cat-file <type> <commitish>

Should be supported everywhere that matters ( since 0.99 ), but it was not always git syntax.

AUTHOR

Kent Fredric <kentfredric@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Kent Fredric <kentfredric@gmail.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.