On 08/24/2014 01:47 PM, James Youngman wrote:
> I tweaked my earlier change to make the turn-over between the
> ChangeLog files the end of 2013.  I hope this makes things simpler for
> you.

Thanks, here comes the patch.
Please run ./import-gnulib.sh after applying the patch.

I'm still a bit unwary about the DO_NOT_WANT_CHANGELOG_DRIVER
env variable. The script 'import-gnulib.sh' is a bit stricter
than the 'bootstrap' script coming with gnulib in this regard.

Have a nice day,
Berny


>From ddf7ae432f7dfdba465fefd5c719bc4a9d6477e8 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <m...@bernhard-voelker.de>
Date: Mon, 25 Aug 2014 09:54:13 +0200
Subject: [PATCH] maint: generate ChangeLog from git commit messages

* ChangeLog: Remove, as it is not maintained manually any longer.
* Makefile.am (gen-ChangeLog): Add phony target to create the ChangeLog
file in the distribution tarball from the git commit messages - starting
from 2014 - and concatenating the file 'ChangeLog-2013'.
(dist-hook): Add the above new target as dependency.
* ChangeLog-2013: Add a newline at the top for nicer separation in
the concatenated ChangeLog file in the distribution tarball.
Bump Copyright year.
* import-gnulib.config (maintainer_modules): Add 'gitlog-to-changelog'
module.  Furthermore create an empty ChangeLog file to silence automake,
and set DO_NOT_WANT_CHANGELOG_DRIVER environment variable as we do not
want the import to fail if the changelog driver is not installed.
* build-aux/git-log-fix: Add rules to fix some git commit messages
during ChangeLog generation.
* build-aux/.gitignore: Add entry for 'gitlog-to-changelog'.
* build-aux/.cvsignore: Likewise.
* .gitignore: Likewise.
* README-hacking: Remove item to add a ChangeLog entry, and instead
mention to give a decent commit message.  In the command sequence for
a complete session, remove ChangeLog editing, too.
* doc/find-maint.texi (Release Information): Remove ChangeLog editing.
*
---
 .gitignore            |   1 +
 ChangeLog             | 224 --------------------------------------------------
 ChangeLog-2013        |   3 +-
 Makefile.am           |  17 +++-
 README-hacking        |   4 +-
 build-aux/.cvsignore  |   1 +
 build-aux/.gitignore  |   1 +
 build-aux/git-log-fix |  21 +++++
 doc/find-maint.texi   |   7 +-
 import-gnulib.config  |   6 ++
 10 files changed, 54 insertions(+), 231 deletions(-)
 delete mode 100644 ChangeLog
 create mode 100644 build-aux/git-log-fix

diff --git a/.gitignore b/.gitignore
index 248d902..ce351cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 ABOUT-NLS
+ChangeLog
 Makefile
 Makefile.in
 aclocal.m4
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 4bbc6ab..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,224 +0,0 @@
-2014-08-24  James Youngman  <j...@gnu.org>
-
-	Stop using the obsolete modules strtol and strtoul.
-	* import-gnulib.config (modules): remove strtol and strtoul.
-
-2014-08-23  James Youngman  <j...@gnu.org>
-
-	Revert the previous ChangeLog split and split at 2013 instead.
-	* ChangeLog-2013: Split the ChangeLog at 2013 rather than 2008;
-	hence, delete ChangeLog-2008.
-	* Makefile.am (EXTRA_DIST): Distribute ChangeLog-2013.
-	* .gitattributes: Use the ChangeLog merge driver for ChangeLog-2013.
-
-	Remove obsolete TODO entries.
-	* TODO: remove BeOS multibyte entry (we fixed this by using the
-	gnulib wcwidth module; see https://savannah.gnu.org/bugs/?19979).
-	Remove comment about problems with gcc-2.95.2 on
-	sparc-sun-sunos4.1.3_U1; we'll look at the problem if anyone ever
-	complains that something doesn't work (though gnulib may in fact
-	no longer work on such an old platform in any case).
-	Remove some TODOs around locate performance; nobody's reported
-	performance issues, and we can examine any specific issues when
-	the arise.
-	Remove TODO about the largeness of depcomp; at 22KiB, it's much
-	smaller than this ChangeLog file, for example.
-
-	Remove obsolete TOLOWER/TOUPPER macros.
-	* locate/locate.c: The TOLOWER and TOUPPER macros are no longer
-	used.   Do not define them.
-	* TODO: Remove obsolete entry for TOLOWER/TOUPPER.
-
-	Don't overflow sig_atomic_t for --max-procs.
-	* xargs/xargs.c (__STDC_LIMIT_MACROS): Define __STDC_LIMIT_MACROS
-	in order to ensure that <stdint.h> defines the SIG_ATOMIC_MAX
-	macro, which we need.
-	(MAX_PROC_MAX): Define this as the maximum allowed value of
-	proc_max.
-	(main): Show the value of MAX_PROC_MAX for --show-limits.
-	(increment_proc_max): Don't increment proc_max beyond
-	MAX_PROC_MAX.
-	(parse_num): Fix small error in the error message; if the limit on
-	the value of a command-line argument is N, explain that the user
-	should specify a value <= N, not < N.
-	* xargs/xargs.1: Document the upper limit on --max-procs.
-	* doc/find.texi (Controlling Parallelism): Document the upper
-	limit on the amount of parallelism.
-	(xargs options): Document the limit on the value you can specify
-	for --max-procs.
-
-	Prepare for later generating the ChangeLog file from the git log.
-	* ChangeLog-2008: Split this file out from the main ChangeLog file.
-	* Makefile.am (EXTRA_DIST): Distribute ChangeLog-2008.
-	* .gitattributes: Use the changelog merge driver for
-	ChangeLog-2008.
-
-2014-08-21  Sami Kerola  <kerol...@iki.fi> (tiny change)
-
-	When reporting failure to change/save directory, mention its name.
-	* find/exec.c (prep_child_for_exec): When issuing an error message
-	about a failure to change directory, mention the directory.
-	* find/util.c (record_initial_cwd): Do the same when saving the
-	initial working directory.
-	(cleanup_initial_cwd): Also when restoring the initial working
-	directory.
-
-2014-08-19  James Youngman  <j...@gnu.org>
-
-	Fix bug #42903: the print statement doesn't exist in Python 3.
-	* find/testsuite/checklists.py (main): Avoid using the print
-	statement as it is not compatible with Python 3.  We use
-	sys.stdout.write, since our needs here are simple.
-
-2014-08-19  Bernhard Voelker <m...@bernhard-voelker.de>
-
-	doc: remove repeated paragraph in locate's texinfo manual
-	* doc/find.texi (Invoking locate): Remove repeated sentence,
-	introduced by commit FINDUTILS_4_2_23-1-28-g1e08148 in 2005.
-	Reported by Dan Jacobsen <jida...@jidanni.org> in
-	http://lists.gnu.org/archive/html/bug-findutils/2014-08/msg00003.html
-	This patch was edited by James Youngman to include a ChangeLog
-	update, hence the changed date.
-
-2014-08-19  James Youngman  <j...@gnu.org>
-
-	Update version to distinguish development tree from 4.5.14.
-	* configure.ac: Update version number.
-	* NEWS: Add header for new version , matching the version number
-	now in configure.ac.
-
-2014-07-19  James Youngman  <j...@gnu.org>
-
-	Release findutils-4.5.14.
-	* configure.ac: Update version number to 4.5.14.
-	* NEWS: Likewise, and add today's date.
-	* po/*: Update with 'make dist'.
-
-	Standardize on "initialize".
-	* find/exec.c (initialise_wd_for_exec): rename to
-	initialize_wd_for_exec, since "initialize" is the preferred form
-	even in UK spelling (the OED says "initialise" is a variant).
-	Update callers (it's a static function).  Update spelling in
-	comments.
-	* find/find.c (main): Fix missing "to" in error message and update
-	"initialise" to "initialize".  Update comment too.
-	* find/ftsfind.c (main): Update spelling in error message.
-	* lib/listfile.c (print_name_with_quoting): spelling change in
-	comment.
-	* find/tree.c (init_pred_perf): Likewise.
-	* lib/extendbuf.c (extendbuf): Likewise.
-	* lib/splitstring.h: Likewise.
-	* find/print.c (format_date): Likewise.
-	* doc/find-maint.texi (Tools): Update spelling.
-
-	Bug #42793: mention the bugfix in NEWS.
-	* NEWS: mention the bugfix.
-
-	Fix bug #42793: "Failed to write output" with -ls.
-	* lib/listfile.c (print_name_with_quoting): Avoid using the
-	variable fprintf_result before it is initialised.  I hope this
-	fixes Savannah bug #42793.
-
-	Update the version number following the recent release.
-	* configure.ac: Move on from 4.5.13.
-	* NEWS: Move on from 4.5.13.
-
-2014-07-16  James Youngman  <j...@gnu.org>
-
-	Prepare for release of 4.5.13.
-	* configure.ac: Change the version number to 4.5.13.
-	* NEWS: Mention some documentation bug fixes which have been
-	applied (ChangeLog entries already exist for these).  Change the
-	version number of the top section of the NEWS file.
-
-2014-05-31  James Youngman  <j...@gnu.org>
-
-	Enable parallel tests.
-	* find/testsuite/Makefile.am (AUTOMAKE_OPTIONS): Enable
-	parallel-tests.  This will only include tests known directly via
-	$(TESTS), not DejaGnu tests.
-
-	Check there are no duplicate configuration entries for test files.
-	* find/testsuite/Makefile.am (EXTRA_DIST_XO): Remove duplicate items.
-	(EXTRA_DIST_EXP): Likewise.
-	(checklists): Run with the other checks, using check-local.  Don't
-	echo the full command, because it will make the summary of the
-	Automake-driven tests scroll offscreen.
-	(TEST_EXTENSIONS): Add .sh and .py.
-
-	Routinely check .xo and .exp test file lists in a clearer way.
-	* find/testsuite/checklists.py: Tiny program for checking that the
-	correct lists of .xo and .exp files exist in the Makefile.am file.
-	* Makefile.am (checklists): Update target to use the new program.
-	Make this target phony.
-
-2014-05-25  Eric S. Raymond  <e...@thyrsus.com>
-
-	Fix errant backslash in find manpage.
-	* find/find.1 (UNUSUAL FILENAMES): Fix errant backslash.
-
-2014-05-12  James Youngman  <j...@gnu.org>
-
-	Update German translation.
-	* po/de.po: Update German translation from the Translation
-	Project.
-
-	Several updates and clarifications to README-hacking.
-	* README-hacking: Explain that tool-versions.txt is not checked
-	into git.  The repository has grown from 14MB to 16MB.  Gnulib is
-	now a submodule and the directory we keep it in has changed.
-	Remove the suggestion to rsync the translations from the
-	translation project, since the files that fetches seem to be out
-	of date.  Move the instruction to update ChangeLog to a more
-	prominent place.  Mention that there is an electronic process for
-	assignments in some locations.  Update the copyright year.
-
-2014-05-11  James Youngman  <j...@gnu.org>
-
-	* gnulib: Update submodule to current version at origin/master.
-
-	Fix inadequte quoting in AC_ARG_ENABLE usage.
-	* configure.ac: Quote second argument of AC_ARG_ENABLE.
-
-2014-01-14  James Youngman  <j...@gnu.org>
-
-	Fix typo "ouptut".
-	* locate/locate.1 (OPTIONS): fix typo "ouptut" (from an anonymous
-	Savannah bug report #40804).
-
-2014-01-12  James Youngman  <j...@gnu.org>
-
-	Add source files to po/POTFILES.in.
-	* po/POTFILES.in: Add some source file names which were missing.
-
-2014-01-12  Nguyễn Thái Ngọc Duy  <pclo...@gmail.com> (tiny change)
-
-	* po/POTFILES.in: mark strings from gnulib for translation.
-
-2014-01-05  James Youngman  <j...@gnu.org>
-
-	Updated various translations from the Translation Project.
-	* po/ru.po: Updated Russian translation from the Translation
-	Project.
-	* po/fr.po: Updated French translation.
-	* po/pt_BR.po: Updated Brazilian Portuguese translation.
-	* po/it.po: Updated Italian translation.
-	* po/sr.po: Updated Serbian translation.
-	* po/eo.po: Updated Esperanto translation.
-	* po/tr.po: Updated Turkish translation.
-	* po/fi.po: Updated Finnish translation.
-	* po/el.po: Updated Greek translation.
-
-	Updated Slovenian translation.
-	* po/sl.po: Updated Slovenian translation from the Translation
-	Project.
-
-	-----
-
-	Copyright (C) 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
-	1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008,
-	2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
-
-	Copying and distribution of this file, with or without
-	modification, are permitted provided the copyright notice
-	and this notice are preserved.
diff --git a/ChangeLog-2013 b/ChangeLog-2013
index 7ce43bd..dd3cdb9 100644
--- a/ChangeLog-2013
+++ b/ChangeLog-2013
@@ -1,3 +1,4 @@
+
 2013-12-08  James Youngman  <j...@gnu.org>
 
 	Bug #35753: check the success/failure of material I/O operations.
@@ -11390,7 +11391,7 @@
 
 	Copyright (C) 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
 	1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008,
-	2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+	2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
 
 	Copying and distribution of this file, with or without
 	modification, are permitted provided the copyright notice
diff --git a/Makefile.am b/Makefile.am
index 93fc7fa..d6dfddd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,8 +25,23 @@ tool-versions.txt: Makefile
 	makeinfo --version ) > $@
 
 
-dist-hook: findutils-check-pofiles findutils-check-testfiles
+dist-hook: gen-ChangeLog findutils-check-pofiles findutils-check-testfiles
 
+.PHONY: gen-ChangeLog
+gen-ChangeLog:
+	$(AM_V_GEN)if test -d .git; then                           \
+	  gen_start_date='2014-01-01' ;                            \
+	  log_fix="$(top_srcdir)/build-aux/git-log-fix" ;          \
+	  test -e "$$log_fix"                                      \
+	    && amend_git_log="--amend=$$log_fix"                   \
+	    || amend_git_log=;                                     \
+	  { $(top_srcdir)/build-aux/gitlog-to-changelog            \
+	      $$amend_git_log --since=$$gen_start_date             \
+	      && cat $(top_srcdir)/ChangeLog-2013 ;                \
+	    } > $(distdir)/cl-t                                    \
+	      && { rm -f $(distdir)/ChangeLog                      \
+	             && mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
+	fi
 
 ## Check that we actually shipped all the .po files.  If this rule fails,
 ## check ALL_LINGUAS in configure.in against the po files in the source
diff --git a/README-hacking b/README-hacking
index 7d38f76..614a15b 100644
--- a/README-hacking
+++ b/README-hacking
@@ -137,11 +137,11 @@ If you plan to submit changes to findutils, please make sure you have
 read the GNU coding standard (http://www.gnu.org/prep/standards/).
 Some common things you might have forgotten to do are:
 
- - add a ChangeLog entry (for now we still do that manually)
  - document your change in both the manual pages and the Texinfo file
  - re-run the test suite (with Dejagnu installed!)
  - add a test case for the bug you're fixing or feature you're adding
  - mention your fix or change (if it's significant) in the NEWS file
+ - commit using a descriptive commit message
 
 If you have patches, please generate them with "git format-patch" and
 mail them to these addresses:
@@ -161,7 +161,7 @@ Here is a complete session
   emacs doc/find.texi xargs/xargs.1
   emacs xargs/testsuite/Makefile.am  xargs/testsuite/xargs.gnu/blah.exp
   make check
-  emacs ChangeLog NEWS
+  emacs NEWS
 
   # make sure you didn't break anything
   make distcheck
diff --git a/build-aux/.cvsignore b/build-aux/.cvsignore
index 35d182e..3575724 100644
--- a/build-aux/.cvsignore
+++ b/build-aux/.cvsignore
@@ -19,3 +19,4 @@ useless-if-before-free
 vc-list-files
 update-copyright
 unused-parameter.h
+gitlog-to-changelog
diff --git a/build-aux/.gitignore b/build-aux/.gitignore
index be5fe6e..fd1a93b 100644
--- a/build-aux/.gitignore
+++ b/build-aux/.gitignore
@@ -18,3 +18,4 @@ compile
 /vc-list-files
 /update-copyright
 /unused-parameter.h
+/gitlog-to-changelog
diff --git a/build-aux/git-log-fix b/build-aux/git-log-fix
new file mode 100644
index 0000000..e597caa
--- /dev/null
+++ b/build-aux/git-log-fix
@@ -0,0 +1,21 @@
+# This file is expected to be used via gitlog-to-changelog's --amend=FILE
+# option.  It specifies what changes to make to each given SHA1's commit
+# log and metadata, using Perl-eval'able expressions.
+
+# Remove superfluous "Conflicts:" marker.
+718bde657248dfc2270f6e0ed16cfb38e2510c2c
+s/Conflicts:$//m;
+s/ChangeLog$//m
+
+# Insert "* " before file name.
+68e2b1d6fd420787903142c02ce1a5e3ea2a7754
+s,(doc/find.texi),* $1,
+
+# Insert "* " before file name.
+603ccd84db3b4b8d6476b9217adeecaa77337781
+s,(find),* $1,
+
+# Insert name of changed file.
+1d6d1afa52f40ad7c776e3ff0d4415409377e6fb
+s/Mark/* po\/POTFILES.in: mark/;
+s/(translation)/$1./
diff --git a/doc/find-maint.texi b/doc/find-maint.texi
index 8b14fd4..0a16afb 100644
--- a/doc/find-maint.texi
+++ b/doc/find-maint.texi
@@ -684,9 +684,10 @@ This file enumerates all changes to the findutils source code (with
 the possible exception of @file{.cvsignore} and @code{.gitignore}
 changes).  The level of detail used for this file should be sufficient
 to answer the questions ``what changed?'' and ``why was it changed?''.
-If a change fixes a bug, always give the bug reference number in both
-the @file{ChangeLog} and @file{NEWS} files and of course also in the
-checkin message.  In general, it should be possible to enumerate all
+The file is generated from the git commit messages during @code{make dist}.
+If a change fixes a bug, always give the bug reference number in the
+@file{NEWS} file and of course also in the checkin message.
+In general, it should be possible to enumerate all
 material changes to a function by searching for its name in
 @file{ChangeLog}.  Mention when each release is made.
 @end table
diff --git a/import-gnulib.config b/import-gnulib.config
index d4fc812..a4f036e 100644
--- a/import-gnulib.config
+++ b/import-gnulib.config
@@ -15,10 +15,16 @@ gpl3_update_files=''
 
 # gnulib modules needed only for maintainer things.
 maintainer_modules='
+gitlog-to-changelog
 maintainer-makefile
 update-copyright
 '
 
+# Automake requires that ChangeLog exists.
+touch ChangeLog
+# Do not fail if the changelog driver is not installed.
+DO_NOT_WANT_CHANGELOG_DRIVER='Y'
+
 # consider using do-release-commit-and-tag
 # consider using gendocs
 # consider using getdelim
-- 
1.8.4.5

Reply via email to