summaryrefslogtreecommitdiff
path: root/gitlog-to-changelog
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2015-06-16 22:29:23 +0200
committerChristophe Lyon <christophe.lyon@linaro.org>2015-06-16 23:20:31 +0200
commit40af5f4dd4c28dfe8455be619b6be9671a1497de (patch)
tree84463cdb44759a57c5a84f6ca8216c18b2be8823 /gitlog-to-changelog
parentbe9913a19711122e445a8e18967ed685b9be5771 (diff)
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.
Diffstat (limited to 'gitlog-to-changelog')
-rwxr-xr-xgitlog-to-changelog9
1 files changed, 9 insertions, 0 deletions
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