Git::Class - a simple git wrapper to capture output
use strict; use warnings; use Git::Class; my $git = Git::Class::Cmd->new; my $worktree = $git->clone('git://github.com/charsbar/git-class.git'); $worktree->add('myfile'); $worktree->commit({ message => 'a commit message' }); $worktree->push; my $captured = $worktree->status; # as a whole my @captured = $worktree->status; # split by "\n"
This is a simple wrapper of a git executable. The strength is that you can run a git command and capture the output in a simple and more portable way than using open to pipe (which is not always implemented fully).
git
open
As of this writing, most of the git commands simply returns the output, but this will be changed in the near future, especially when called in the list context, where we may want sort of proccessed data like what files are affected etc.
Git::Class::Cmd
Git::Class::Worktree
Kenichi Ishigaki, <ishigaki@cpan.org>
Copyright (C) 2009 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Git::Class, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Git::Class
CPAN shell
perl -MCPAN -e shell install Git::Class
For more information on module installation, please visit the detailed CPAN module installation guide.