summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2012-01-02 07:54:42 -0500
committerNeil Moore <neil@s-z.org>2012-01-02 07:54:42 -0500
commit55f5087293a04c999d0d8dc3a839f4e5c706887a (patch)
tree0bd5baa21e6e1e5460ba3927b7f6915fccb73736 /lib
parent60d65a94006aa7efb8205394b088a6fc1ea54f2a (diff)
downloadcrawlbot-55f5087293a04c999d0d8dc3a839f4e5c706887a.tar.gz
crawlbot-55f5087293a04c999d0d8dc3a839f4e5c706887a.zip
Report only new branches, not commits.
CIA handles commit reporting fairly well as it is; but does not report new branches.
Diffstat (limited to 'lib')
-rw-r--r--lib/Crawl/Bot/Plugin/Commit.pm35
1 files changed, 19 insertions, 16 deletions
diff --git a/lib/Crawl/Bot/Plugin/Commit.pm b/lib/Crawl/Bot/Plugin/Commit.pm
index 0b57b4f..c2706d9 100644
--- a/lib/Crawl/Bot/Plugin/Commit.pm
+++ b/lib/Crawl/Bot/Plugin/Commit.pm
@@ -51,26 +51,29 @@ sub tick {
chomp ($old_head, $head);
next if $old_head eq $head;
- if (!$self->has_branch($branch)) {
- $self->say_all("New branch created: $branch");
- }
-
my @revs = split /\n/, `git rev-list $old_head..$head`;
- 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;
- $self->say_all("Cherry-picked $cherry_picks commits into $branch")
- if $cherry_picks > 0;
-
- for my $rev (@revs) {
- my $commit = $commits{$rev};
- my $abbr = substr($rev, 0, 12);
- $self->say_all("$commit->{author} * r$abbr ($commit->{nfiles} changed): $commit->{subject}");
+ if (!$self->has_branch($branch)) {
+ my $nrev = scalar @revs;
+ $self->say_all("New branch created: $branch ($nrev 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;
+# $self->say_all("Cherry-picked $cherry_picks commits into $branch")
+# if $cherry_picks > 0;
+#
+# 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* r$abbr ($commit->{nfiles} changed): $commit->{subject}");
+# }
+
$self->head($branch => $head);
}
}