summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-04-07 00:00:55 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-04-07 00:00:55 -0700
commit23468561682aea0705249a469f614bb873e4f411 (patch)
tree0f9627efff11eaec69cbe91a730ccfdda2f1396e /Makefile.in
parentdd1404cca3cf6bc459bc53f9aa9528170e30efd4 (diff)
downloademacs-23468561682aea0705249a469f614bb873e4f411.tar.gz
Generate a ChangeLog file from commit logs
* .gitignore: Add 'ChangeLog'. * build-aux/gitlog-to-changelog: New file, from Gnulib. * build-aux/gitlog-to-emacslog: New file. * CONTRIBUTE: Document the revised workflow. * Makefile.in (clean): Remove *.tmp and etc/*.tmp* instead of just special cases. (CHANGELOG_HISTORY_INDEX_MAX, CHANGELOG_N, gen_origin): New vars. (ChangeLog, unchanged-history-files, change-history) (change-history-commit): New rules. * admin/admin.el (make-manuals-dist--1): Don't worry about doc/ChangeLog. * admin/authors.el: Add a FIXME. * admin/make-tarball.txt: * lisp/calendar/icalendar.el: * lisp/gnus/deuglify.el: * lisp/obsolete/gulp.el: * lwlib/README: Adjust to renamed ChangeLog history files. * admin/merge-gnulib (GNULIB_MODULES): Add gitlog-to-changelog. * admin/notes/repo: Call it 'master' a la Git, not 'trunk' a la Bzr. Remove obsolete discussion of merging ChangeLog files. New section "Maintaining ChangeLog history". * build-aux/git-hooks/pre-commit: Reject attempts to commit files named 'ChangeLog'. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * make-dist: Make and distribute top-level ChangeLog if there's a .git directory. Distribute the new ChangeLog history files instead of scattered ChangeLog files. Distribute the new files gitlog-to-changelog and gitlog-to-emacslog. Fixes: bug#19113
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in40
1 files changed, 39 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index 4cdd293ebd4..55fb54a156c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -833,7 +833,7 @@ clean: $(clean_dirs:=_clean)
for dir in test/automated; do \
[ ! -d $$dir ] || $(MAKE) -C $$dir clean; \
done
- -rm -f etc/emacs.tmpdesktop etc/emacs.tmpappdata
+ -rm -f *.tmp etc/*.tmp*
-rm -rf info-dir.*
### `bootclean'
@@ -1087,6 +1087,44 @@ bootstrap: bootstrap-clean
$(MAKE) MAKEFILE_NAME=force-Makefile force-Makefile
$(MAKE) all
+# The newest revision that should not appear in the generated ChangeLog.
+gen_origin = 9d56a21e6a696ad19ac65c4b405aeca44785884a
+# Convert git commit log to ChangeLog file. make-dist uses this.
+.PHONY: ChangeLog change-history unchanged-history-files
+ChangeLog:
+ $(AM_V_GEN)distprefix=$(distprefix) srcprefix=$(srcdir)/ \
+ $(srcdir)/build-aux/gitlog-to-emacslog $(gen_origin)
+
+# The ChangeLog history files are called ChangeLog.1, ChangeLog.2, ...,
+# ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX). $(CHANGELOG_N) stands for
+# the newest (highest-numbered) ChangeLog history file.
+CHANGELOG_HISTORY_INDEX_MAX = 1
+CHANGELOG_N = ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX)
+
+# Check that history-relevant files match what's in the repository.
+# Otherwise, 'make change-history' might mess up the ChangeLog history files.
+unchanged-history-files:
+ x=$$(git diff-files --name-only $(CHANGELOG_N) Makefile.in) && \
+ test -z "$$x"
+
+# Copy newer commit messages to the start of the ChangeLog history file,
+# and consider them to be older.
+change-history: ChangeLog unchanged-history-files
+ (sed '/^Copyright/,$$d' <ChangeLog && cat $(CHANGELOG_N)) \
+ >$(CHANGELOG_N).tmp
+ new_origin=$$(git log --pretty=format:%H HEAD^!) && \
+ sed 's/^\(gen_origin *= *\).*/\1'"$$new_origin/" \
+ <Makefile.in >Makefile.in.tmp
+ mv $(CHANGELOG_N).tmp $(CHANGELOG_N)
+ mv Makefile.in.tmp Makefile.in
+ $(MAKE) $@-commit
+
+# If 'make change-history' fails because the newest ChangeLog history
+# file contains invalid text, fix the file by hand and then run
+# 'make change-history-commit'.
+change-history-commit:
+ git commit -m'; make $@' $(CHANGELOG_N) Makefile.in
+
.PHONY: check-declare
check-declare: