logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Git::Sub - git commands imported as System::Sub subs in the git:: namespace

Author

       Olivier Mengué, "dolmen@cpan.org".

Description

       Use git <http://www.git-scm.com> commands easily from your Perl program. Each git command is imported as
       a System::Sub DWIM sub.

Examples

       •   The    release   script   <https://github.com/dolmen/angel-PS1/blob/devel/dist>   of   my   angel-PS1
           <https://github.com/dolmen/angel-PS1> project.

Name

       Git::Sub - git commands imported as System::Sub subs in the git:: namespace

Synopsis

           use Git::Sub qw(clone tag push);

           # Git commands are now Perl subs
           git::clone 'git://github.com/dolmen/p5-Git-Sub.git';

           git::tag -a => -m => "Release v$version", "v$version";

           git::push qw(--tags origin master);

           # Commands names with '-' are imported with '_'
           my $master = git::rev_parse 'release';

           # Return in list context is lines (see System::Sub)
           say for git::ls_tree 'master';

           # Process lines using a callback
           git::ls_tree 'master' => sub {
               my ($mode, $type, $object, $file) = split;
               say $file;
           };

Version

       version 0.163320

See Also