From 73fdc0fdd27e8f0b289dbbd83097656079b997fc Mon Sep 17 00:00:00 2001 From: Neil Moore Date: Sun, 19 Aug 2012 01:27:07 -0500 Subject: Use more detailed format for commit announcements. --- lib/Crawl/Bot/Plugin/Commit.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Crawl/Bot/Plugin/Commit.pm b/lib/Crawl/Bot/Plugin/Commit.pm index 651876d..7acdd2a 100644 --- a/lib/Crawl/Bot/Plugin/Commit.pm +++ b/lib/Crawl/Bot/Plugin/Commit.pm @@ -106,9 +106,18 @@ sub tick { for my $rev (@revs) { my $commit = $commits{$rev}; - my $abbr = substr($rev, 0, 12); my $br = $branch eq "master" ? "" : "[$branch] "; - $self->say_all("$commit->{author} $br* $abbr ($commit->{nfiles} changed): $commit->{subject}"); + + my $abbr = substr($commit->{hash}, 0, 12); + my $pl = ($commit->{nfiles} == 1 ? "" : "s"); + + my $revname = $commit->{revname} || "r$abbr"; + + $self->say_all("$commit->{author} * $revname: $commit->{subject} " + . "($commit->{date}, $commit->{nfiles} file$pl, " + . "$commit->{nins}+ $commit->{ndel}-) " + . "https://gitorious.org/crawl/crawl/commit/$abbr" + ); } } -- cgit v1.2.3-54-g00ecf