summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2012-08-19 01:27:07 -0500
committerNeil Moore <neil@s-z.org>2012-08-19 13:42:13 -0500
commit73fdc0fdd27e8f0b289dbbd83097656079b997fc (patch)
tree366bdb5010e527dc5900bda6f8d0e606dac59591 /lib
parent09f515cf90ec6a9d9c62dfa2229d2753639ce42e (diff)
downloadcrawlbot-73fdc0fdd27e8f0b289dbbd83097656079b997fc.tar.gz
crawlbot-73fdc0fdd27e8f0b289dbbd83097656079b997fc.zip
Use more detailed format for commit announcements.
Diffstat (limited to 'lib')
-rw-r--r--lib/Crawl/Bot/Plugin/Commit.pm13
1 files changed, 11 insertions, 2 deletions
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"
+ );
}
}