[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] [RFC] Allow amendments when generating ChangeLog
From: |
Robert Pluim |
Subject: |
[PATCH] [RFC] Allow amendments when generating ChangeLog |
Date: |
Thu, 21 Jun 2018 12:33:08 +0200 |
In theory the way ChangeLogs are now generated itʼs possible to amend
them after the fact, but nobody every implemented support for
that. Attached a patch to allow specifying specific amendments to the
ChangeLog entries for specific commits, plus a totally randomly chosen
example.
Regards
Robert
>From 6347165027e78d9ac792dc407c60c550bb83046d Mon Sep 17 00:00:00 2001
From: Robert Pluim <address@hidden>
Date: Thu, 21 Jun 2018 12:06:49 +0200
Subject: [PATCH] Allow amendments when generating ChangeLog
To: address@hidden
* Makefile.in (AMEND_FILE): New variable to specify file used
for ChangeLog amendments.
(ChangeLog): Pass AMEND_FILE to ChangeLog generation script.
* build-aux/amend-emacs-26.txt: New file. Contains commands to
perform ChangeLog amendments.
* build-aux/gitlog-to-emacslog: Add --amend argument parsing.
Pass the result to gitlog-to-changelog.
---
Makefile.in | 4 +++-
build-aux/amend-emacs-26.txt | 3 +++
build-aux/gitlog-to-emacslog | 11 +++++++++++
3 files changed, 17 insertions(+), 1 deletion(-)
create mode 100644 build-aux/amend-emacs-26.txt
diff --git a/Makefile.in b/Makefile.in
index 238df40ded..fd279477ae 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1113,9 +1113,11 @@ CHANGELOG_N =
# Convert git commit log to ChangeLog file. make-dist uses this.
# I guess this is PHONY so it always updates?
+AMEND_FILE = build-aux/amend-emacs-`echo ${version} | sed 's/\..*//'`.txt
ChangeLog:
$(AM_V_GEN)cd $(srcdir) && \
- ./$(emacslog) -o $(CHANGELOG) -n $(CHANGELOG_HISTORY_INDEX_MAX)
+ ./$(emacslog) -o $(CHANGELOG) -n $(CHANGELOG_HISTORY_INDEX_MAX) \
+ --amend $(AMEND_FILE)
# Check that we are in a good state for changing history.
PREFERRED_BRANCH = emacs-26
diff --git a/build-aux/amend-emacs-26.txt b/build-aux/amend-emacs-26.txt
new file mode 100644
index 0000000000..8ca0d85819
--- /dev/null
+++ b/build-aux/amend-emacs-26.txt
@@ -0,0 +1,3 @@
+40e1db8ccd1239fc7da5ccd3f5f79017b2b44afc
+# satisfy Robert's grammatical peeves
+s/reflect it's/reflect its/
diff --git a/build-aux/gitlog-to-emacslog b/build-aux/gitlog-to-emacslog
index bdf45360aa..77b3c6d59d 100755
--- a/build-aux/gitlog-to-emacslog
+++ b/build-aux/gitlog-to-emacslog
@@ -35,6 +35,7 @@ nmax=
-f|--force) force=1 ;;
-n|--nmax) nmax="$2"; shift ;;
-o|--output) output="$2" ; shift ;;
+ -a|--amend) amend_file="$2" ; shift ;;
*) printf '%s\n' "Unrecognized argument: $1" >&2; exit 1 ;;
esac
shift
@@ -67,6 +68,15 @@ new_origin=
rm -f "$output" || exit 1
fi
+if [ "$amend_file" ]; then
+ if [ ! -f $amend_file ]; then
+ printf '%s\n' "Can't find amend file $amend_file" >&2
+ exit 1
+ else
+ amend_args="--amend=$amend_file"
+ fi
+fi
+
# If this is not a Git repository, just generate an empty ChangeLog.
test -r .git || {
>"$output"
@@ -79,6 +89,7 @@ new_origin=
./build-aux/gitlog-to-changelog \
--ignore-matching="^; |^Merge branch '[^']*' of
git\.(savannah|sv)\.gnu\.org:/srv/git/emacs|^Merge remote-tracking branch
'.*'$" \
--ignore-line='^; ' --format='%B' \
+ $amend_args \
"$gen_origin..$new_origin" >"ChangeLog.tmp" || exit
if test -r "ChangeLog.tmp"; then
--
2.18.0.rc1
- [PATCH] [RFC] Allow amendments when generating ChangeLog,
Robert Pluim <=