From 92822428a2739c16caf12e75a4bba24258da3ec3 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sun, 30 Oct 2011 05:01:00 +0400 Subject: [PATCH] gitlog-to-changelog: treat a message with only blank lines as empty * build-aux/gitlog-to-changelog: Move the code that removes leading and trailing blank lines before the code that issues a warning about an empty commit message. --- ChangeLog | 7 +++++++ build-aux/gitlog-to-changelog | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 603a16f5d..30cc2af8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-10-29 Dmitry V. Levin + + gitlog-to-changelog: treat a message with only blank lines as empty. + * build-aux/gitlog-to-changelog: Move the code that removes leading and + trailing blank lines before the code that issues a warning about an + empty commit message. + 2011-10-30 Jim Meyering test-parse-datetime.c: avoid new DST-related false positive test failure diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index 45597041e..a5fd80db6 100755 --- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -152,6 +152,10 @@ sub quoted_cmd(@) # Omit "Signed-off-by..." lines. @line = grep !/^Signed-off-by: .*>$/, @line; + # Remove leading and trailing blank lines. + while ($line[0] =~ /^\s*$/) { shift @line; } + while ($line[$#line] =~ /^\s*$/) { pop @line; } + # If there were any lines if (@line == 0) { @@ -159,10 +163,6 @@ sub quoted_cmd(@) } else { - # Remove leading and trailing blank lines. - while ($line[0] =~ /^\s*$/) { shift @line; } - while ($line[$#line] =~ /^\s*$/) { pop @line; } - # Prefix each non-empty line with a TAB. @line = map { length $_ ? "\t$_" : '' } @line; -- 2.11.0