From 1450fe313464fbad490485eb6396f65514975e26 Mon Sep 17 00:00:00 2001 From: Neil Moore Date: Thu, 11 Oct 2012 10:43:51 -0500 Subject: Limit commit announcements. Announce at most ten commits per update (number is tunable). --- lib/Crawl/Bot/Plugin/Commit.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Crawl/Bot/Plugin/Commit.pm b/lib/Crawl/Bot/Plugin/Commit.pm index 320dcb0..71d75ce 100644 --- a/lib/Crawl/Bot/Plugin/Commit.pm +++ b/lib/Crawl/Bot/Plugin/Commit.pm @@ -16,6 +16,12 @@ has announce_commits => ( default => 1, ); +has announce_limit => ( + is => 'rw', + isa => 'Int', + default => 10, +); + has colour_announce => ( is => 'rw', isa => 'Bool', @@ -160,7 +166,11 @@ sub tick { $self->say_all("Cherry-picked $cherry_picks commit$pl into $branch") if $cherry_picks > 0; + my $count = 0; for my $rev (@revs) { + if (++$count > $self->announce_limit) { + $self->say_all("... and " . (scalar @revs - $count + 1) . " more commits"); + } my $commit = $commits{$rev}; my $br = $branch eq "master" ? "" : "[$branch] "; -- cgit v1.2.3