From 40af5f4dd4c28dfe8455be619b6be9671a1497de Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Tue, 16 Jun 2015 22:29:23 +0200 Subject: Add --strip-change-id option. Gerrit uses Change-Id: tags which we don't want to print in the generated ChangeLog. This new option enables to suppress this information. --- gitlog-to-changelog | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gitlog-to-changelog') diff --git a/gitlog-to-changelog b/gitlog-to-changelog index 78afff4..9639c0f 100755 --- a/gitlog-to-changelog +++ b/gitlog-to-changelog @@ -79,6 +79,7 @@ OPTIONS: --strip-cherry-pick remove data inserted by "git cherry-pick"; this includes the "cherry picked from commit ..." line, and the possible final "Conflicts:" paragraph. + --strip-change-id remove lines starting with "Change-Id:". --help display this help and exit --version output version information and exit @@ -226,6 +227,7 @@ sub git_dir_option($) my $cluster = 1; my $strip_tab = 0; my $strip_cherry_pick = 0; + my $strip_change_id = 0; my $srcdir; GetOptions ( @@ -238,6 +240,7 @@ sub git_dir_option($) 'cluster!' => \$cluster, 'strip-tab' => \$strip_tab, 'strip-cherry-pick' => \$strip_cherry_pick, + 'strip-change-id' => \$strip_change_id, 'srcdir=s' => \$srcdir, ) or usage 1; @@ -306,6 +309,12 @@ sub git_dir_option($) $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m; } + # Remove lines containing starting with "Change-Id:". + if ($strip_change_id) + { + $rest =~ s/^\s*Change-Id:.*//sm; + } + my @line = split "\n", $rest; my $author_line = shift @line; defined $author_line -- cgit v1.2.3