Git::Repository::Command - Command objects for running git
use Git::Repository::Command; # invoke an external git command, and return an object $cmd = Git::Repository::Command->(@cmd); # a Git::Repository object can provide more context $cmd = Git::Repository::Command->( $r, @cmd ); # options can be passed as a hashref $cmd = Git::Repository::Command->( $r, @cmd, \%option ); # $cmd is basically a hash $cmd->{stdin}; # filehandle to the process' stdin (write) $cmd->{stdout}; # filehandle to the process' stdout (read) $cmd->{stderr}; # filehandle to the process' stdout (read) $cmd->{pid}; # pid of the child process # done! $cmd->close(); # exit information $cmd->{exit}; # exit status $cmd->{signal}; # signal $cmd->{core}; # core dumped? (boolean)
Git::Repository::Command is a class that actually launches a git commands, allowing to interact with it through its STDIN, STDOUT and STDERR.
Git::Repository::Command
STDIN
STDOUT
STDERR
This module is meant to be invoked through Git::Repository.
Git::Repository
Git::Repository::Command supports the following methods:
Runs a git command with the parameters in @cmd.
@cmd
If @cmd contains a Git::Repository object, it is used to provide context to the git command.
If @cmd contains a hash reference, it is taken as an option hash. The recognized keys are:
git
The actual git binary to run. By default, it is just git.
cwd
The current working directory in which the git command will be run.
env
A hashref containing key / values to add to the git command environment.
input
A string that is send to the git command standard input, which is then closed.
If several option hashes are passed to new(), only the first one will be used.
new()
The hash returned by new() has the following keys:
$cmd->{stdin}; # filehandle to the process' stdin (write) $cmd->{stdout}; # filehandle to the process' stdout (read) $cmd->{stderr}; # filehandle to the process' stdout (read) $cmd->{pid}; # pid of the child process
Close all pipes to the child process, and collects exit status, etc.
This adds the following keys to the hash:
$cmd->{exit}; # exit status $cmd->{signal}; # signal $cmd->{core}; # core dumped? (boolean)
Philippe Bruhat (BooK), <book at cpan.org>
<book at cpan.org>
Copyright 2010 Philippe Bruhat (BooK), all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Git::Repository, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Git::Repository
CPAN shell
perl -MCPAN -e shell install Git::Repository
For more information on module installation, please visit the detailed CPAN module installation guide.