summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2013-12-26 17:59:35 -0600
committerNeil Moore <neil@s-z.org>2013-12-26 18:01:24 -0600
commit123a2dea45234d5f00edf18db347c0abb7e716d8 (patch)
treed78f9aa5468f41943766eb28370b24a033744852
parent31115d605ebf45e21ef4bec77089faba4723be7f (diff)
downloadcrawlbot-123a2dea45234d5f00edf18db347c0abb7e716d8.tar.gz
crawlbot-123a2dea45234d5f00edf18db347c0abb7e716d8.zip
Don't add a stray "r" before untagged commit hashes
-rw-r--r--lib/Crawl/Bot/Plugin/Commit.pm31
1 files changed, 21 insertions, 10 deletions
diff --git a/lib/Crawl/Bot/Plugin/Commit.pm b/lib/Crawl/Bot/Plugin/Commit.pm
index 4c6071d..1901116 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 abbrev_cherry_picks => (
+ is => 'rw',
+ isa => 'Bool',
+ default => 0,
+);
+
# Maximum number of commits to announce from a large batch. If there
# are exactly announce_limits + 1 new commits, all of them will be
# announced, to avoid a useless "and 1 more commit" message.
@@ -124,7 +130,7 @@ sub said {
my $abbr = substr($commit->{hash}, 0, 12);
my $pl = ($commit->{nfiles} == 1 ? "" : "s");
- my $rev = $commit->{revname} || "r$abbr";
+ my $rev = $commit->{revname} || "$abbr";
my $committer = "";
if ($commit->{committer} ne $commit->{author}) {
$committer = " {" . $commit->{committer} . "}";
@@ -200,14 +206,19 @@ sub tick {
if ($self->announce_commits) {
my %commits = map { $_, $self->parse_commit($_) } @revs;
- my $cherry_picks = @revs;
- @revs = grep { $commits{$_}->{subject} !~ /\(cherry picked from /
- && $commits{$_}->{body} !~ /\(cherry picked from / } @revs;
- $cherry_picks -= @revs;
- my $pl = $cherry_picks == 1 ? "" : "s";
-
- $say->("Cherry-picked $cherry_picks commit$pl into $branch")
- if $cherry_picks > 0;
+ if ($self->abbrev_cherry_picks)
+ {
+ my $cherry_picks = @revs;
+ @revs = grep {
+ $commits{$_}->{subject} !~ /\(cherry picked from /
+ && $commits{$_}->{body} !~ /\(cherry picked from /
+ } @revs;
+ $cherry_picks -= @revs;
+ my $pl = $cherry_picks == 1 ? "" : "s";
+
+ $say->("Cherry-picked $cherry_picks commit$pl into $branch")
+ if $cherry_picks > 0;
+ }
my $count = 0;
for my $rev (reverse @revs) {
@@ -223,7 +234,7 @@ sub tick {
my $abbr = substr($commit->{hash}, 0, 12);
my $pl = ($commit->{nfiles} == 1 ? "" : "s");
- my $revname = $commit->{revname} || "r$abbr";
+ my $revname = $commit->{revname} || "$abbr";
my $committer = "";
if ($commit->{committer} ne $commit->{author}) {
$committer = " {" . $commit->{committer} . "}";