From 84a9458ca2f34d779b8a847a32fb82be058d2403 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 15 Feb 2010 03:34:24 -0600 Subject: a few more fixes --- lib/Crawl/Bot/Plugin/Commit.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Crawl/Bot/Plugin/Commit.pm b/lib/Crawl/Bot/Plugin/Commit.pm index 8e74115..5bb59cd 100644 --- a/lib/Crawl/Bot/Plugin/Commit.pm +++ b/lib/Crawl/Bot/Plugin/Commit.pm @@ -69,7 +69,8 @@ sub tick { for my $rev (@revs) { my $commit = $commits{$rev}; - $self->say_all("$commit->{author} * r$rev ($commit->{nfiles} changed): $commit->{subject}"); + my $abbr = substr($rev, 0, 12); + $self->say_all("$commit->{author} * r$abbr ($commit->{nfiles} changed): $commit->{subject}"); } $self->head($branch => $head); @@ -87,9 +88,9 @@ sub parse_commit { my ($rev) = @_; my $dir = pushd($self->checkout); my $info = `git log -1 --pretty=format:%aN%x00%s%x00%b%x00 $rev`; - $info =~ /(.*?)\0(.*?)\0(.*?)\0(.*?)/; + $info =~ /(.*?)\x00(.*?)\x00(.*?)\x00(.*?)/s; my ($author, $subject, $body, $stat) = ($1, $2, $3, $4); - $stat =~ s/(\d+) files changed//; + $stat =~ s/(\d+) files changed/$1/; return { author => $author, subject => $subject, -- cgit v1.2.3-54-g00ecf