Mercurial > hg > octave-kai > gnulib-hg
changeset 16005:645961f2b4e5
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.
author | Dmitry V. Levin <ldv@altlinux.org> |
---|---|
date | Sun, 30 Oct 2011 05:01:00 +0400 |
parents | 83b923a6f599 |
children | 1f375d0c606b |
files | ChangeLog build-aux/gitlog-to-changelog |
diffstat | 2 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-10-29 Dmitry V. Levin <ldv@altlinux.org> + + 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 <meyering@redhat.com> test-parse-datetime.c: avoid new DST-related false positive test failure
--- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -152,6 +152,10 @@ # 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 @@ } 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;