Meta/cook: use the committer date of the tip commit
Earlier I used to use author date, but committer date is a better measure of the age of the topic considering that topics in pu can be and are sometimes amended.
Junio C Hamano committed
May 11, 2011 at 13:08 UTC
36ac3d9f0c0a770673883c2b70f73fb8aa042bc5
1 file changed
+10
-5
cook
+10
-5
index 38fb0d3d4f..4bd6fcc331 100755
--- a/cook
+++ b/cook
@@ -110,7 +110,7 @@ sub get_commit {
my $fh;
open($fh, '-|',
qw(git for-each-ref),
- "--format=%(refname:short) %(authordate:iso8601)",
+ "--format=%(refname:short) %(committerdate:iso8601)",
"refs/heads/??/*")
or die "$!: open for-each-ref";
my @topic;
@@ -612,14 +612,19 @@ sub wildo {
if (defined $topic) {
wildo_queue(\%what, "Undecided", $topic);
}
- # tip-date, next-date, topic, count
- $topic = [$2, $too_recent, $1, $3];
+ # tip-date, next-date, topic, count, pu-count
+ $topic = [$2, $too_recent, $1, $3, 0];
+ next;
}
if (defined $topic &&
($topic->[1] eq $too_recent) &&
+ ($topic->[4] == 0) &&
(/^ \(merged to 'next' on ([-0-9]+)/)) {
$topic->[1] = $1;
}
+ if (defined $topic && /^ - /) {
+ $topic->[4]++;
+ }
next if (/^ /);
if (defined $topic &&
/Will (?:\S+ )?merge /i) {
@@ -633,10 +638,10 @@ sub wildo {
for $topic (sort { (($a->[1] cmp $b->[1]) ||
($a->[0] cmp $b->[0])) }
@{$what{$what}}) {
- my ($tip, $next, $name, $count) = @$topic;
+ my ($tip, $next, $name, $count, $pu) = @$topic;
my ($sign);
$tip =~ s/^\d{4}-//;
- if ($next eq $too_recent) {
+ if (($next eq $too_recent) || (0 < $pu)) {
$sign = "-";
$next = " " x 6;
} else {