]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Meta/cook: hold topics in 'next' by default during -rc period
authorJunio C Hamano <gitster@pobox.com>
Wed, 18 Oct 2017 02:57:13 +0000 (11:57 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Oct 2017 02:57:13 +0000 (11:57 +0900)
cook

diff --git a/cook b/cook
index 7370f95bb3367f750d7f5346b56d15c1f46fbd3d..5e2b2c97d5de9df9a546301e0889381cd83feef5 100755 (executable)
--- a/cook
+++ b/cook
@@ -547,20 +547,31 @@ sub topic_in_pu {
        return 0;
 }
 
+my $mergetomaster;
+
 sub tweak_willdo {
        my ($td) = @_;
        my $desc = $td->{'desc'};
        my $text = $td->{'text'};
 
+       if (!defined $mergetomaster) {
+               my $master = `git describe master`;
+               if ($master =~ /-rc\d+(-\d+-g[0-9a-f]+)?$/) {
+                       $mergetomaster = "Will cook in 'next'.";
+               } else {
+                       $mergetomaster = "Will merge to 'master'.";
+               }
+       }
+
        # If updated description (i.e. the list of patches with
        # merge trail to 'next') has 'merged to next', then
        # tweak the topic to be slated to 'master'.
        # NEEDSWORK: does this work correctly for a half-merged topic?
        $desc =~ s/\n<<\n.*//s;
        if ($desc =~ /^  \(merged to 'next'/m) {
-               $text =~ s/^ Will merge to 'next'\.$/ Will merge to 'master'./m;
+               $text =~ s/^ Will merge to 'next'\.$/ $mergetomaster/m;
                $text =~ s/^ Will merge to and then cook in 'next'\.$/ Will cook in 'next'./m;
-               $text =~ s/^ Will merge to 'next' and then to 'master'\.$/ Will merge to 'master'./m;
+               $text =~ s/^ Will merge to 'next' and then to 'master'\.$/ $mergetomaster/m;
        }
        $td->{'text'} = $text;
 }