summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-10-05 16:06:01 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-10-05 16:06:01 +0100
commit989fbe475b9041f780a58a613b2126da5edb8f8a (patch)
tree48f6f02beb6be14a927b934b4da017aec31c0904
parent68c507d55880b0f44c61834c8e1515f2cec1b73c (diff)
downloadvirt-top-989fbe475b9041f780a58a613b2126da5edb8f8a.zip
virt-top-989fbe475b9041f780a58a613b2126da5edb8f8a.tar.gz
virt-top-989fbe475b9041f780a58a613b2126da5edb8f8a.tar.xz
gitlog-to-changelog: If the date field is empty, don't barf.
-rwxr-xr-xgitlog-to-changelog30
1 files changed, 14 insertions, 16 deletions
diff --git a/gitlog-to-changelog b/gitlog-to-changelog
index a0f8a08..cf0fef0 100755
--- a/gitlog-to-changelog
+++ b/gitlog-to-changelog
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# Convert git log output to ChangeLog format.
-my $VERSION = '2009-08-12 16:49'; # UTC
+my $VERSION = '2009-10-05 15:04'; # UTC
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
@@ -132,20 +132,18 @@ sub quoted_cmd(@)
my $author_line = shift @line;
defined $author_line
or die "$ME:$.: unexpected EOF\n";
- $author_line =~ /^(\d+) (.*>)$/
- or die "$ME:$.: Invalid line "
- . "(expected date/author/email):\n$author_line\n";
-
- my $date_line = sprintf "%s $2\n", strftime ("%F", localtime ($1));
- # If this line would be the same as the previous date/name/email
- # line, then arrange not to print it.
- if ($date_line ne $prev_date_line)
- {
- $prev_date_line eq ''
- or print "\n";
- print $date_line;
- }
- $prev_date_line = $date_line;
+ if ($author_line =~ /^(\d+) (.*>)$/) {
+ my $date_line = sprintf "%s $2\n", strftime ("%F", localtime ($1));
+ # If this line would be the same as the previous date/name/email
+ # line, then arrange not to print it.
+ if ($date_line ne $prev_date_line)
+ {
+ $prev_date_line eq ''
+ or print "\n";
+ print $date_line;
+ }
+ $prev_date_line = $date_line;
+ }
# Omit "Signed-off-by..." lines.
@line = grep !/^Signed-off-by: .*>$/, @line;
@@ -153,7 +151,7 @@ sub quoted_cmd(@)
# If there were any lines
if (@line == 0)
{
- warn "$ME: warning: empty commit message:\n $date_line\n";
+ warn "$ME: warning: empty commit message:\n $prev_date_line\n";
}
else
{