]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Meta/cook: support --newer to list 'new iteration exists'
authorJunio C Hamano <gitster@pobox.com>
Fri, 10 Jul 2026 19:13:54 +0000 (12:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jul 2026 19:13:54 +0000 (12:13 -0700)
cook

diff --git a/cook b/cook
index 99250cf516d7838e6112d6500aa6d9962f48d08e..55b0e14b9e37e8021991e2f5581f293fd4bdb357 100755 (executable)
--- a/cook
+++ b/cook
@@ -1165,13 +1165,38 @@ sub doit {
        write_cooking('Meta/whats-cooking.txt', $cooking);
 }
 
+################################################################
+
+################################################################
+# Newer one exists?
+
+sub newer {
+       my $fn = 'Meta/whats-cooking.txt';
+       my $fh;
+       my $last_topic;
+
+       open ($fh, '<', $fn) or die "$!: open $fn";
+       while (<$fh>) {
+               chomp;
+               if (/^[*] (\S+) \(\d\d\d\d-\d\d-\d\d\)/) {
+                       $last_topic = $1;
+                       next;
+               }
+               if (/^ \(a newer iteration/) {
+                       print "$last_topic\n$_\n";
+               }
+       }
+       close ($fh);
+}
+
 ################################################################
 # Main
 
 use Getopt::Long;
 
-my ($wildo, $havedone);
+my ($wildo, $havedone, $newer);
 if (!GetOptions("wildo" => \$wildo,
+               "newer" => \$newer,
                "havedone" => \$havedone)) {
        print STDERR "$0 [--wildo|--havedone]\n";
        exit 1;
@@ -1200,6 +1225,8 @@ if ($wildo) {
                open($fd, "<", $ARGV[0]);
        }
        wildo($fd);
+} elsif ($newer) {
+       newer();
 } elsif ($havedone) {
        havedone();
 } elsif (@ARGV) {