all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] [RFC] Allow amendments when generating ChangeLog
Date: Thu, 21 Jun 2018 12:33:08 +0200	[thread overview]
Message-ID: <87sh5g2zvf.fsf@gmail.com> (raw)

[-- 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


             reply	other threads:[~2018-06-21 10:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21 10:33 Robert Pluim [this message]
2018-06-21 20:40 ` [PATCH] [RFC] Allow amendments when generating ChangeLog Paul Eggert
2018-06-22  8:21   ` Robert Pluim
2018-06-22 18:28     ` Paul Eggert
2018-06-25 14:34       ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sh5g2zvf.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.