+2012-05-15 Akim Demaille <akim@lrde.epita.fr>
+
+ gitlog-to-changelog: support the log message format used in Bison.
+ * build-aux/gitlog-to-changelog: Support --strip-tab and
+ --strip-cherry-picked.
+
2012-05-21 Paolo Bonzini <bonzini@gnu.org>
poll/select: prevent busy-waiting. SwitchToThread() only gives away
if 0;
# Convert git log output to ChangeLog format.
-my $VERSION = '2012-01-18 07:50'; # UTC
+my $VERSION = '2012-05-22 09:40'; # 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
--format=FMT set format string for commit subject and body;
see 'man git-log' for the list of format metacharacters;
the default is '%s%n%b%n'
-
+ --strip-tab remove one additional leading TAB from commit message lines.
+ --strip-cherry-pick remove data inserted by "git cherry-pick";
+ this includes the "cherry picked from commit ..." line,
+ and the possible final "Conflicts:" paragraph.
--help display this help and exit
--version output version information and exit
my $amend_file;
my $append_dot = 0;
my $cluster = 1;
+ my $strip_tab = 0;
+ my $strip_cherry_pick = 0;
GetOptions
(
help => sub { usage 0 },
'amend=s' => \$amend_file,
'append-dot' => \$append_dot,
'cluster!' => \$cluster,
+ 'strip-tab' => \$strip_tab,
+ 'strip-cherry-pick' => \$strip_cherry_pick,
) or usage 1;
$rest = $_;
}
+ # Remove lines inserted by "git cherry-pick".
+ if ($strip_cherry_pick)
+ {
+ $rest =~ s/^\s*Conflicts:\n.*//sm;
+ $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m;
+ }
+
my @line = split "\n", $rest;
my $author_line = shift @line;
defined $author_line
}
}
+ # Remove one additional leading TAB from each line.
+ $strip_tab
+ and map { s/^\t// } @line;
+
# Prefix each non-empty line with a TAB.
@line = map { length $_ ? "\t$_" : '' } @line;