Skip to content

Commit

Permalink
s/body/message/g; documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans Dieter Pearcey committed Jun 19, 2008
1 parent 5c3580e commit eba2ae4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Revision history for Git-Wrapper

0.004 xxxx-xx-xx
0.004 2008-06-19

add links to other git-related things

Expand Down
31 changes: 25 additions & 6 deletions lib/Git/Wrapper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ sub log {
$current->attr->{lc $1} = $2;
$_ = shift @out;
}
die "no blank line separating head from body" if $_;
my $body = '';
die "no blank line separating head from message" if $_;
my $message = '';
while (@out and length($_ = shift @out)) {
s/^\s+//;
$body .= "$_\n";
$message .= "$_\n";
}
$current->body($body);
$current->message($message);
push @logs, $current;
}

Expand Down Expand Up @@ -145,7 +145,7 @@ sub id { shift->{id} }

sub attr { shift->{attr} }

sub body { @_ > 1 ? ($_[0]->{body} = $_[1]) : $_[0]->{body} }
sub message { @_ > 1 ? ($_[0]->{message} = $_[1]) : $_[0]->{message} }

sub date { shift->attr->{date} }

Expand All @@ -167,7 +167,7 @@ Git::Wrapper - wrap git(7) command-line interface
my $git = Git::Wrapper->new('/var/foo');
$git->commit(...)
print for $git->log;
print $_->message for $git->log;
=head1 DESCRIPTION
Expand Down Expand Up @@ -220,6 +220,25 @@ The exception stringifies to the error message.
print $git->dir; # /var/foo
=head2 log
my @logs = $git->log;
Instead of giving back an arrayref of lines, the C<log> method returns a list
of C<Git::Wrapper::Log> objects. They have four methods:
=over
=item * id
=item * author
=item * date
=item * message
=back
=head1 SEE ALSO
L<VCI::VCS::Git> is the git implementation for L<VCI>, a generic interface to
Expand Down
2 changes: 1 addition & 1 deletion t/basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ my @log = $git->log;
is(@log, 1, 'one log entry');
my $log = $log[0];
is($log->id, (split /\s/, $rev_list[0])[0], 'id');
is($log->body, "FIRST\n", "body");
is($log->message, "FIRST\n", "message");
is($log->date, $date, "date");

0 comments on commit eba2ae4

Please sign in to comment.