]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Meta/cook: use the committer date of the tip commit
authorJunio C Hamano <gitster@pobox.com>
Wed, 11 May 2011 20:08:07 +0000 (13:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 May 2011 20:08:07 +0000 (13:08 -0700)
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.

cook

diff --git a/cook b/cook
index 38fb0d3d4f64ca3c638e1efc99f771b9a6f5a8b9..4bd6fcc331308eab7aa0644f917923b2f56706c0 100755 (executable)
--- 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 {