Title: [90229] trunk/Tools
Revision
90229
Author
[email protected]
Date
2011-07-01 08:21:02 -0700 (Fri, 01 Jul 2011)

Log Message

commit-log-editor reorders ChangeLog entries in unexpected ways
https://bugs.webkit.org/show_bug.cgi?id=63804

Reviewed by Darin Adler.

commit-log-editor was changed in r46899 to move the bug title and URL to the top of the
commit message in order to make git-based tools, which expect the first line of the commit
message to be a summary of the change, to work better. But this reordering of the ChangeLog
entry was unpredictable and unexpected.

I changed prepare-ChangeLog to put the bug title and URL at the top of the ChangeLog entry
so that commit-log-editor doesn't have to move them. Then I changed commit-log-editor not to
try to move them.

* Scripts/commit-log-editor: Partially reverted r46899. We no longer save the "Reviewed by"
line and try to move it down below the bug title and URL. The order of the text in the
ChangeLog is now preserved, except that we insert a "Patch by" line just above the "Reviewed
by" line in cases where the committer and author are not the same person.

* Scripts/prepare-ChangeLog: Moved the "Reviewed by" line down below the bug title and URL.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (90228 => 90229)


--- trunk/Tools/ChangeLog	2011-07-01 14:51:31 UTC (rev 90228)
+++ trunk/Tools/ChangeLog	2011-07-01 15:21:02 UTC (rev 90229)
@@ -1,3 +1,26 @@
+2011-07-01  Adam Roben  <[email protected]>
+
+        commit-log-editor reorders ChangeLog entries in unexpected ways
+        https://bugs.webkit.org/show_bug.cgi?id=63804
+
+        Reviewed by Darin Adler.
+
+        commit-log-editor was changed in r46899 to move the bug title and URL to the top of the
+        commit message in order to make git-based tools, which expect the first line of the commit
+        message to be a summary of the change, to work better. But this reordering of the ChangeLog
+        entry was unpredictable and unexpected.
+
+        I changed prepare-ChangeLog to put the bug title and URL at the top of the ChangeLog entry
+        so that commit-log-editor doesn't have to move them. Then I changed commit-log-editor not to
+        try to move them.
+
+        * Scripts/commit-log-editor: Partially reverted r46899. We no longer save the "Reviewed by"
+        line and try to move it down below the bug title and URL. The order of the text in the
+        ChangeLog is now preserved, except that we insert a "Patch by" line just above the "Reviewed
+        by" line in cases where the committer and author are not the same person.
+
+        * Scripts/prepare-ChangeLog: Moved the "Reviewed by" line down below the bug title and URL.
+
 2011-07-01  Mihnea Ovidenie  <[email protected]>
 
         Reviewed by Adam Roben.

Modified: trunk/Tools/Scripts/commit-log-editor (90228 => 90229)


--- trunk/Tools/Scripts/commit-log-editor	2011-07-01 14:51:31 UTC (rev 90228)
+++ trunk/Tools/Scripts/commit-log-editor	2011-07-01 15:21:02 UTC (rev 90229)
@@ -152,7 +152,6 @@
     open CHANGELOG, $changeLog or die "Can't open $changeLog";
     my $contents = "";
     my $blankLines = "";
-    my $reviewedByLine = "";
     my $lineCount = 0;
     my $date = "";
     my $author = "";
@@ -163,20 +162,14 @@
             last if $contents;
         }
         if (/\S/) {
-            my $previousLineWasBlank = 1 unless $blankLines eq "";
-            my $line = $_;
-            my $currentLineBlankLines = $blankLines;
+            $contents .= $blankLines if $contents;
             $blankLines = "";
 
+            my $line = $_;
+
             # Remove indentation spaces
             $line =~ s/^ {8}//;
 
-            # Save the reviewed / rubber stamped by line.
-            if ($line =~ m/^Reviewed by .*/ || $line =~ m/^Rubber[ \-]?stamped by .*/) {
-                $reviewedByLine = $line;
-                next;
-            }
-
             # Grab the author and the date line
             if ($line =~ m/^([0-9]{4}-[0-9]{2}-[0-9]{2})\s+(.*[^\s])\s+<(.*)>/ && $lineCount == 0) {
                 $date = $1;
@@ -186,10 +179,8 @@
                 next;
             }
 
-            $contents .= $currentLineBlankLines if $contents;
-
-            # Attempt to insert the "patch by" line, after the first blank line.
-            if ($previousLineWasBlank && $hasAuthorInfoToWrite && $lineCount > 0) {
+            if ($line =~ m/^Reviewed by .*/ || $line =~ m/^Rubber[ \-]?stamped by .*/) {
+                # Insert the "Patch by" line just above the "Reviewed by" line, if needed.
                 my $committerEmail = changeLogEmailAddress();
                 my $authorAndCommitterAreSamePerson = $email eq $committerEmail;
                 if (!$authorAndCommitterAreSamePerson) {
@@ -198,11 +189,6 @@
                 }
             }
 
-            # Attempt to insert the "reviewed by" line, after the first blank line.
-            if ($previousLineWasBlank && $reviewedByLine && $lineCount > 0) {
-                $contents .= $reviewedByLine . "\n";
-                $reviewedByLine = "";
-            }
 
             $lineCount++;
             $contents .= $line;
@@ -210,9 +196,6 @@
             $blankLines .= $_;
         }
     }
-    if ($reviewedByLine) {
-        $contents .= "\n".$reviewedByLine;
-    }
     close CHANGELOG;
 
     $changeLog = File::Spec->abs2rel(File::Spec->rel2abs($changeLog), $topLevel);

Modified: trunk/Tools/Scripts/prepare-ChangeLog (90228 => 90229)


--- trunk/Tools/Scripts/prepare-ChangeLog	2011-07-01 14:51:31 UTC (rev 90228)
+++ trunk/Tools/Scripts/prepare-ChangeLog	2011-07-01 15:21:02 UTC (rev 90229)
@@ -393,7 +393,6 @@
     my ($reviewer, $description) = reviewerAndDescriptionForGitCommit($gitCommit) if $gitCommit;
     $reviewer = "NOBODY (OO" . "PS!)" if !$reviewer;
 
-    print CHANGE_LOG normalizeLineEndings("        Reviewed by $reviewer.\n\n", $endl);
     print CHANGE_LOG normalizeLineEndings($description . "\n", $endl) if $description;
 
     $bugDescription = "Need a short description and bug URL (OOPS!)" unless $bugDescription;
@@ -401,6 +400,8 @@
     print CHANGE_LOG normalizeLineEndings("        $bugURL\n", $endl) if $bugURL;
     print CHANGE_LOG normalizeLineEndings("\n", $endl);
 
+    print CHANGE_LOG normalizeLineEndings("        Reviewed by $reviewer.\n\n", $endl);
+
     if ($prefix =~ m/WebCore/ || `pwd` =~ m/WebCore/) {
         if ($didChangeRegressionTests) {
             print CHANGE_LOG normalizeLineEndings(testListForChangeLog(sort @addedRegressionTests), $endl);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to