NAME

Git::Hook::PostReceive -

SYNOPSIS

# hooks/post-receive
use Git::Hook::PostReceive;
my $payload = Git::Hook::PostReceive->new->read_stdin( <STDIN> );

$payload->{new_head}; 
$payload->{delete}; 

$payload->{before};
$payload->{after};
$payload->{ref_type}; # tags or heads

for my $commit (@{ $payload->{commits} } ) {
    $commit->{id};
    $commit->{author}->{name};
    $commit->{author}->{email};
    $commit->{message};
    $commit->{date};
}

DESCRIPTION

Git::Hook::PostReceive parses git commit information in post-receive hook script.

all you need to do is pass the stdin string to Git::Hook::PostReceive, then it returns the commit payload .

INSTALLATION

Git::Hook::PostReceive installation is straightforward. If your CPAN shell is set up, you should just be able to do

% cpan Git::Hook::PostReceive

Download it, unpack it, then build it as per the usual:

% perl Makefile.PL
% make && make test

Then install it:

% make install

DOCUMENTATION

Git::Hook::PostReceive documentation is available as in POD. So you can do:

% perldoc Git::Hook::PostReceive

to read the documentation online with your favorite pager.

AUTHOR

Yo-An Lin <cornelius.howl {at} gmail.com>

SEE ALSO

LICENSE

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