bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] gitlog-to-changelog: don't output spurious header lines.


From: Gary V. Vaughan
Subject: [PATCH 1/2] gitlog-to-changelog: don't output spurious header lines.
Date: Thu, 3 Jan 2013 20:23:29 +0700

From: "Gary V. Vaughan" <address@hidden>

Move the code for printing header lines inside the else clause of
the empty commit message warning if... so you either get a warning,
or you get the ChangeLog header followed by the non-empty commit
message.

* build-aux/gitlog-to-changelog: When there is no commit message to
add to ChangeLog, don't output a fresh header line.
---
 build-aux/gitlog-to-changelog | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index e02d34c..5261081 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -351,26 +351,6 @@ sub git_dir_option($)
               . substr ($_, 5) . "\n";
         }
 
-      # If clustering of commit messages has been disabled, if this header
-      # would be different from the previous date/name/email/coauthors header,
-      # or if this or the previous entry consists of two or more paragraphs,
-      # then print the header.
-      if ( ! $cluster
-          || $date_line ne $prev_date_line
-          || "@coauthors" ne "@prev_coauthors"
-          || $multi_paragraph
-          || $prev_multi_paragraph)
-        {
-          $prev_date_line eq ''
-            or print "\n";
-          print $date_line;
-          @coauthors
-            and print join ("\n", @coauthors), "\n";
-        }
-      $prev_date_line = $date_line;
-      @prev_coauthors = @coauthors;
-      $prev_multi_paragraph = $multi_paragraph;
-
       # If there were any lines
       if (@line == 0)
         {
@@ -378,6 +358,26 @@ sub git_dir_option($)
         }
       else
         {
+          # If clustering of commit messages has been disabled, if this header
+          # would be different from the previous date/name/email/coauthors 
header,
+          # or if this or the previous entry consists of two or more 
paragraphs,
+          # then print the header.
+          if ( ! $cluster
+              || $date_line ne $prev_date_line
+              || "@coauthors" ne "@prev_coauthors"
+              || $multi_paragraph
+              || $prev_multi_paragraph)
+            {
+              $prev_date_line eq ''
+                or print "\n";
+              print $date_line;
+              @coauthors
+                and print join ("\n", @coauthors), "\n";
+            }
+          $prev_date_line = $date_line;
+          @prev_coauthors = @coauthors;
+          $prev_multi_paragraph = $multi_paragraph;
+
           if ($append_dot)
             {
               # If the first line of the message has enough room, then
-- 
1.8.0.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]