unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] [RFC] Allow amendments when generating ChangeLog
@ 2018-06-21 10:33 Robert Pluim
  2018-06-21 20:40 ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Pluim @ 2018-06-21 10:33 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Allow-amendments-when-generating-ChangeLog.patch --]
[-- Type: text/x-diff, Size: 2924 bytes --]

From 6347165027e78d9ac792dc407c60c550bb83046d Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim@gmail.com>
Date: Thu, 21 Jun 2018 12:06:49 +0200
Subject: [PATCH] Allow amendments when generating ChangeLog
To: emacs-devel@gnu.org

* 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-25 14:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-21 10:33 [PATCH] [RFC] Allow amendments when generating ChangeLog Robert Pluim
2018-06-21 20:40 ` Paul Eggert
2018-06-22  8:21   ` Robert Pluim
2018-06-22 18:28     ` Paul Eggert
2018-06-25 14:34       ` Robert Pluim

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).