11# !/usr/bin/perl -w
22# Maintain "what's cooking" messages
33
4+ my $MASTER = ' master' ; # for now
5+
46use strict;
57
68my %reverts = (' next' => {
@@ -66,7 +68,7 @@ sub topic_relation {
6668 my $fh ;
6769 open ($fh , ' -|' ,
6870 qw( git log --abbrev) , " --format=%m %h " ,
69- " $one ...$two " , " ^master " )
71+ " $one ...$two " , " ^$MASTER " )
7072 or die " $! : open log --left-right" ;
7173 my (@left , @right );
7274 while (<$fh >) {
@@ -107,7 +109,7 @@ Returns a hash:
107109=cut
108110
109111sub get_commit {
110- my (@base ) = qw( master next seen) ;
112+ my (@base ) = ( $MASTER , ' next' , ' seen' );
111113 my $fh ;
112114 open ($fh , ' -|' ,
113115 qw( git for-each-ref) ,
@@ -206,8 +208,8 @@ sub get_commit {
206208
207209 open ($fh , ' -|' ,
208210 qw( git log --first-parent --abbrev) ,
209- " --format=%ci %h %p :%s " , " master ..next" )
210- or die " $! : open log master ..next" ;
211+ " --format=%ci %h %p :%s " , " $MASTER ..next" )
212+ or die " $! : open log $MASTER ..next" ;
211213 while (<$fh >) {
212214 my ($date , $commit , $parent , $tips );
213215 unless (($date , $commit , $parent , $tips ) =
@@ -220,7 +222,7 @@ sub get_commit {
220222 $co -> {' merged' } = " (merged to 'next' on $date at $commit )" ;
221223 }
222224 }
223- close ($fh ) or die " $! : close log master ..next" ;
225+ close ($fh ) or die " $! : close log $MASTER ..next" ;
224226
225227 for my $branch (keys %topic ) {
226228 my @log = ();
300302To: git\@ vger.kernel.org
301303Bcc: lwn\@ lwn.net
302304Subject: What's cooking in git.git ($mon $year , #$issue ; $dow , $date )
303- X-master -at: $master_at
305+ X-$MASTER -at: $master_at
304306X-next-at: $next_at
305307
306308What's cooking in git.git ($mon $year , #$issue ; $dow , $date )
314316
315317my $blurb_match = <<'EOF' ;
316318(?:(?i:\s*[a-z]+: .*|\s.*)\n)*?Subject: What's cooking in \S+ \((\w+) (\d+), #(\d+); (\w+), (\d+)\)
317- X-master -at: ([0-9a-f]{40})
319+ X-[a-z]* -at: ([0-9a-f]{40})
318320X-next-at: ([0-9a-f]{40})
319321
320322What's cooking in \S+ \(\1 \2, #\3; \4, \5\)
@@ -476,7 +478,7 @@ sub write_cooking {
476478 close ($fh );
477479}
478480
479- my $graduated = ' Graduated to "master" ' ;
481+ my $graduated = " Graduated to ' $MASTER ' " ;
480482my $new_topics = ' New Topics' ;
481483my $discarded = ' Discarded' ;
482484my $cooking_topics = ' Cooking' ;
@@ -488,11 +490,11 @@ sub update_issue {
488490 open ($fh , ' -|' ,
489491 qw( git for-each-ref) ,
490492 " --format=%(refname:short) %(objectname)" ,
491- " refs/heads/master " ,
493+ " refs/heads/$MASTER " ,
492494 " refs/heads/next" ) or die " $! : open for-each-ref" ;
493495 while (<$fh >) {
494496 my ($branch , $at ) = /^(\S+) (\S+)$/ ;
495- if ($branch eq ' master ' ) { $master_at = $at ; }
497+ if ($branch eq $MASTER ) { $master_at = $at ; }
496498 if ($branch eq ' next' ) { $next_at = $at ; }
497499 }
498500 close ($fh ) or die " $! : close for-each-ref" ;
@@ -564,11 +566,11 @@ sub tweak_willdo {
564566 my $text = $td -> {' text' };
565567
566568 if (!defined $mergetomaster ) {
567- my $master = ` git describe master ` ;
569+ my $master = ` git describe $MASTER ` ;
568570 if ($master =~ / -rc\d +(-\d +-g[0-9a-f]+)?$ / ) {
569571 $mergetomaster = " Will cook in 'next'." ;
570572 } else {
571- $mergetomaster = " Will merge to 'master '." ;
573+ $mergetomaster = " Will merge to '$MASTER '." ;
572574 }
573575 }
574576
@@ -580,7 +582,7 @@ sub tweak_willdo {
580582 if ($desc =~ / ^ \( merged to 'next'/m ) {
581583 $text =~ s / ^ Will merge to 'next'\. $/ $mergetomaster / m ;
582584 $text =~ s / ^ Will merge to and (then )?cook in 'next'\. $/ Will cook in 'next'./ m ;
583- $text =~ s / ^ Will merge to 'next' and (then )?to 'master '\. $/ Will merge to 'master './ m ;
585+ $text =~ s / ^ Will merge to 'next' and (then )?to '$MASTER '\. $/ Will merge to '$MASTER './ m ;
584586 }
585587 $td -> {' text' } = $text ;
586588}
@@ -590,7 +592,7 @@ sub tweak_graduated {
590592
591593 # Remove the "Will merge" marker from topics that have graduated.
592594 for ($td -> {' text' }) {
593- s /\n Will merge to 'master '\. (\n |$)// s ;
595+ s /\n Will merge to '$MASTER '\. (\n |$)// s ;
594596 }
595597}
596598
@@ -825,12 +827,13 @@ sub havedone {
825827 my ($topic , $to_maint , %to_maint , %merged , $in_desc );
826828 if (!@ARGV ) {
827829 open ($fh , ' -|' ,
828- qw( git rev-list --first-parent -1 master Documentation/RelNotes RelNotes) )
830+ qw( git rev-list --first-parent -1) , $MASTER ,
831+ qw( -- Documentation/RelNotes RelNotes) )
829832 or die " $! : open rev-list" ;
830833 my ($rev ) = <$fh >;
831834 close ($fh ) or die " $! : close rev-list" ;
832835 chomp $rev ;
833- @ARGV = (" $rev ..master " );
836+ @ARGV = (" $rev ..$MASTER " );
834837 }
835838 open ($fh , ' -|' ,
836839 qw( git log --first-parent --oneline --reverse) , @ARGV )
0 commit comments