Meta/candidates: show number of patches in candidate topics
Junio C Hamano committed
Jul 8, 2010 at 07:55 UTC
949c621cf0be2186fc5d91bd75cb1ac891968087
1 file changed
+43
candidates
new
+43
@@ -0,0 +1,43 @@
1
+#!/usr/bin/perl
2
+# Feed whats-cooking to this to find what to merge to 'master'
3
+
4
+sub merged {
5
+ my ($topic, $base) = @_;
6
+ my $fh;
7
+ (open $fh, "-|", qw(git rev-list), "^$base", $topic)
8
+ or die "$!";
9
+ my $count = 0;
10
+ while (<$fh>) {
11
+ $count++;
12
+ }
13
+ (close $fh)
14
+ or die "$! (after $count for $topic)";
15
+ return $count;
16
+}
17
+
18
+my ($topic, $topic_date);
19
+my (@candidate);
20
+
21
+while (<>) {
22
+ if (/^\* ([a-z][a-z]\/[-a-z0-9_]+) \(([-0-9]{10})\) \d+ commit/) {
23
+ $topic = $1;
24
+ $topic_date = $2;
25
+ next;
26
+ }
27
+ if (defined $topic) {
28
+ if (/^ \(merged to 'next' on ([-0-9]{10}) at/) {
29
+ push @candidate, [$topic, $1, $topic_date];
30
+ next;
31
+ }
32
+ $topic = undef;
33
+ $topic_date = undef;
34
+ }
35
+}
36
+
37
+for $topic (sort { ($a->[1] cmp $b->[1]) || ($a->[2] cmp $b->[2]) } @candidate) {
38
+ my $count = merged($topic->[0], 'master');
39
+ if ($count) {
40
+ print "$topic->[1] $topic->[2] ($count) $topic->[0]\n";
41
+ }
42
+}
43
+