]> git.ipfire.org Git - thirdparty/git.git/commitdiff
WIP: slight updates to What's cooking script
authorJunio C Hamano <gitster@pobox.com>
Thu, 6 Nov 2008 01:03:43 +0000 (17:03 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Nov 2008 01:03:43 +0000 (17:03 -0800)
UWC
WC

diff --git a/UWC b/UWC
index 7391dedc9fe648f3eca85efc1d0cdb58f881b44d..7a513af2ee3a21793b02bf402130c61318427274 100755 (executable)
--- a/UWC
+++ b/UWC
@@ -2,7 +2,7 @@
 #
 # Update an older edition of What's Cooking with the latest data.
 #
-# Usage: UWC [ old [ new ] ]
+# Usage: UWC [--keep-master] [ old [ new ] ]
 #
 # Giving no parameter is the same as giving a single "-" to the command.
 #
@@ -28,6 +28,8 @@
 # previously sent in a buffer in Emacs, and filter the buffer contents
 # with this script, to prepare an up-to-date message.
 
+my $keep_master = 1;
+
 sub parse_whats_cooking {
        my ($fh) = @_;
        my $head = undef;
@@ -179,15 +181,27 @@ sub merge_whats_cooking {
                }
        }
 
-       if (%{$new_wc->{"topic hash"}}) {
-               if (@gone) {
-                       $group = 'Graduated to "master"';
-                       if (!exists $old_wc->{" $group"}) {
-                               unshift @{$old_wc->{"group list"}}, $group;
-                               $old_wc->{" $group"} = [];
-                       }
-                       push @{$old_wc->{" $group"}}, @gone;
+
+       $group = 'Graduated to "master"';
+       if (!$keep_master) {
+               print STDERR "Not Keeping Master\n";
+               my $o = delete $old_wc->{" $group"};
+               for (@$o) {
+                       print STDERR " Dropping: ", $_->{'topic'}, "\n";
+               }
+               print STDERR "Gone are\n";
+               for (@gone) {
+                       print STDERR " Gone: ", $_->{'topic'}, "\n";
+               }
+       }
+       if (@gone) {
+               if (!exists $old_wc->{" $group"}) {
+                       unshift @{$old_wc->{"group list"}}, $group;
+                       $old_wc->{" $group"} = [];
                }
+               push @{$old_wc->{" $group"}}, @gone;
+       }
+       if (%{$new_wc->{"topic hash"}}) {
                $group = "New Topics";
                if (!exists $old_wc->{" $group"}) {
                        unshift @{$old_wc->{"group list"}}, $group;
@@ -204,6 +218,9 @@ sub merge_whats_cooking {
 
 if (@ARGV == 0) {
        @ARGV = ('-');
+} elsif ($ARGV[0] eq '--keep-master') {
+       $keep_master = 1;
+       shift;
 }
 if (@ARGV != 2 && @ARGV != 1) {
        die "Usage: $0 old [new]\n";
diff --git a/WC b/WC
index 3e60c3ad79f67699be8509960874eba890827c64..ef1bda7518833c3809d382543ee23f136888b873 100755 (executable)
--- a/WC
+++ b/WC
@@ -4,6 +4,7 @@
 master_at=$(git rev-parse --verify refs/heads/master)
 next_at=$(git rev-parse --verify refs/heads/next)
 
+keep_master=
 case "$1" in
 generate)
        echo Here are the topics that have been
@@ -11,6 +12,9 @@ generate)
        Meta/git-topic.perl --base=master | sed -e 's/^\*./\n*/'
        exit
        ;;
+keep)
+       keep_master=--keep-master
+       ;;
 esac
 
 eval $(LC_ALL=C date +"monthname=%b month=%m year=%Y date=%d dow=%a")
@@ -48,4 +52,4 @@ last=$(
 )
 
 sed -e 's/^\[New Topics\]$/[Old New Topics]/' "Meta/$last" |
-Meta/UWC
+Meta/UWC $keep_master