Reintegrate: remove the "what next" markers from log messages

Junio C Hamano committed May 24, 2013 at 14:12 UTC dfe39c3fe194db1fd15877887aaa61538def7060
1 file changed +20 -1
Reintegrate
+20 -1
@@ -25,6 +25,16 @@ annotate_merge () {
25 test -f Meta/whats-cooking.txt || return 0
26
27 perl -e '
28 + sub wildo_match {
29 + s/^\s*//;
30 + if (/^Will (?:\S+ ){0,2}(fast-track|keep|merge|drop|discard|cook|kick|defer|be re-?rolled)[,. ]/ ||
31 + /^Not urgent/ || /^Not ready/ || /^Waiting for / ||
32 + /^Needs? / || /^Expecting / || /^May want to /) {
33 + return 1;
34 + }
35 + return 0;
36 + }
37 +
38 my ($branch) = $ARGV[0];
39 my ($in_section, $in_desc);
40 my @msg = ();
@@ -41,12 +51,15 @@ annotate_merge () {
51 $in_desc = 1;
52 }
53 next unless ($in_section && $in_desc);
54 + next if (/Originally merged to '\''next'\'' on ([-0-9]+)/);
55 + next if (wildo_match($_));
56 push @msg, "$_\n";
57 }
58
59 if ($in_section && @msg) {
60 open(my $fh, "-|", qw(git cat-file commit HEAD));
61 my @original = (<$fh>);
62 + close $fh;
63 my @final;
64 $in_section = 0;
65 for (@original) {
@@ -54,6 +67,13 @@ annotate_merge () {
67 $in_section = 1 if (/^$/);
68 next;
69 }
70 + if (/^Conflicts:$/ && $in_section == 2) {
71 + $in_section = 3;
72 + }
73 +
74 + if ($in_section == 3) {
75 + $_ = "# $_";
76 + }
77 push @final, $_;
78 if (/^$/ && $in_section == 1) {
79 push @final, @msg;
@@ -61,7 +81,6 @@ annotate_merge () {
81 $in_section = 2;
82 }
83 }
64 - close $fh;
84 open($fh, "|-", qw(git commit --amend -F -));
85 print $fh @final;
86 close $fh;