aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2015-05-18 21:41:03 -0400
committerGlenn Morris2015-05-18 21:41:03 -0400
commit314244aac44525a32dc9ea0a3ec94f77f055d332 (patch)
tree1322996d0f0469ece1fc81d09e714eb641a82a56
parent88e4dfaadb1daf6f1ce0e80442af5a2dae7853bc (diff)
downloademacs-314244aac44525a32dc9ea0a3ec94f77f055d332.tar.gz
emacs-314244aac44525a32dc9ea0a3ec94f77f055d332.zip
Add option to ignore commit lines matching a pattern in ChangeLog.
* build-aux/gitlog-to-changelog: Add --ignore-line option. * build-aux/gitlog-to-emacslog: Ignore lines matching '^; '. ; * CONTRIBUTE: Mention this.
-rw-r--r--CONTRIBUTE3
-rwxr-xr-xbuild-aux/gitlog-to-changelog11
-rwxr-xr-xbuild-aux/gitlog-to-emacslog2
3 files changed, 14 insertions, 2 deletions
diff --git a/CONTRIBUTE b/CONTRIBUTE
index bf231554261..526d8dac4fb 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -96,6 +96,9 @@ messages:
96- Commit messages should not contain the "Signed-off-by:" lines that 96- Commit messages should not contain the "Signed-off-by:" lines that
97 are used in some other projects. 97 are used in some other projects.
98 98
99- Any lines of the the commit message that start with "; " are omitted
100 from the generated ChangeLog.
101
99- Explaining the rationale for a design choice is best done in comments 102- Explaining the rationale for a design choice is best done in comments
100 in the source code. However, sometimes it is useful to describe just 103 in the source code. However, sometimes it is useful to describe just
101 the rationale for a change; that can be done in the commit message 104 the rationale for a change; that can be done in the commit message
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index ad7c2739cbc..9abb693dabe 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
3 if 0; 3 if 0;
4# Convert git log output to ChangeLog format. 4# Convert git log output to ChangeLog format.
5 5
6my $VERSION = '2015-05-08 06:05'; # UTC 6my $VERSION = '2015-05-19 01:37'; # UTC
7# The definition above must lie within the first 8 lines in order 7# The definition above must lie within the first 8 lines in order
8# for the Emacs time-stamp write hook (at end) to update it. 8# for the Emacs time-stamp write hook (at end) to update it.
9# If you change this file with Emacs, please let the write hook 9# If you change this file with Emacs, please let the write hook
@@ -74,6 +74,7 @@ OPTIONS:
74 the default is to convert all log entries. 74 the default is to convert all log entries.
75 --until=DATE convert only the logs older than DATE. 75 --until=DATE convert only the logs older than DATE.
76 --ignore-matching=PAT ignore commit messages whose first lines match PAT. 76 --ignore-matching=PAT ignore commit messages whose first lines match PAT.
77 --ignore-line=PAT ignore lines of commit messages that match PAT.
77 --format=FMT set format string for commit subject and body; 78 --format=FMT set format string for commit subject and body;
78 see 'man git-log' for the list of format metacharacters; 79 see 'man git-log' for the list of format metacharacters;
79 the default is '%s%n%b%n' 80 the default is '%s%n%b%n'
@@ -228,6 +229,7 @@ sub git_dir_option($)
228 my $append_dot = 0; 229 my $append_dot = 0;
229 my $cluster = 1; 230 my $cluster = 1;
230 my $ignore_matching; 231 my $ignore_matching;
232 my $ignore_line;
231 my $strip_tab = 0; 233 my $strip_tab = 0;
232 my $strip_cherry_pick = 0; 234 my $strip_cherry_pick = 0;
233 my $srcdir; 235 my $srcdir;
@@ -242,6 +244,7 @@ sub git_dir_option($)
242 'append-dot' => \$append_dot, 244 'append-dot' => \$append_dot,
243 'cluster!' => \$cluster, 245 'cluster!' => \$cluster,
244 'ignore-matching=s' => \$ignore_matching, 246 'ignore-matching=s' => \$ignore_matching,
247 'ignore-line=s' => \$ignore_line,
245 'strip-tab' => \$strip_tab, 248 'strip-tab' => \$strip_tab,
246 'strip-cherry-pick' => \$strip_cherry_pick, 249 'strip-cherry-pick' => \$strip_cherry_pick,
247 'srcdir=s' => \$srcdir, 250 'srcdir=s' => \$srcdir,
@@ -349,6 +352,12 @@ sub git_dir_option($)
349 if (! (defined $ignore_matching 352 if (! (defined $ignore_matching
350 && @line && $line[0] =~ /$ignore_matching/)) 353 && @line && $line[0] =~ /$ignore_matching/))
351 { 354 {
355 if (defined $ignore_line && @line)
356 {
357 @line = grep ! /$ignore_line/, @line;
358 while ($line[$#line] =~ /^\s*$/) { pop @line; }
359 }
360
352 # Record whether there are two or more paragraphs. 361 # Record whether there are two or more paragraphs.
353 my $multi_paragraph = grep /^\s*$/, @line; 362 my $multi_paragraph = grep /^\s*$/, @line;
354 363
diff --git a/build-aux/gitlog-to-emacslog b/build-aux/gitlog-to-emacslog
index aa4206005c3..d1b1af9b538 100755
--- a/build-aux/gitlog-to-emacslog
+++ b/build-aux/gitlog-to-emacslog
@@ -58,7 +58,7 @@ test -d .git || {
58 58
59# Use Gnulib's packaged ChangeLog generator. 59# Use Gnulib's packaged ChangeLog generator.
60./build-aux/gitlog-to-changelog --ignore-matching='^; ' \ 60./build-aux/gitlog-to-changelog --ignore-matching='^; ' \
61 --format='%B' \ 61 --ignore-line='^; ' --format='%B' \
62 "$gen_origin.." >"ChangeLog.tmp" || exit 62 "$gen_origin.." >"ChangeLog.tmp" || exit
63 63
64if test -s "ChangeLog.tmp"; then 64if test -s "ChangeLog.tmp"; then