Skip to content

Commit

Permalink
maint: generate ChangeLog from git log
Browse files Browse the repository at this point in the history
Following the practice set by various other GNU projects, we start
to automatically generate the ChangeLog file from the git commit
messages.  This will avoid duplication (as the ChangeLog entries
were always inserted both in the git commit message and in the
version-controlled ChangeLog file), and potential problems with
spurious merge conflicts (which, although greatly mitigated by
Bruno Haible's `git-merge-changelog' helper program, have never
been completely solved).

* ChangeLog: Moved ...
* ChangeLog.3: ... to this.
* build-aux/gitlog-to-changelog: New script, synced from gnulib.
* cfg.mk (gnulib-update): Also sync gitlog-to-changelog.
* Makefile.am (gen-ChangeLog): New .PHONY rule, generate the
ChangeLog for distribution.
(dist-hook): Depend on it.
($(srcdir)/ChangeLog): New dummy rule, to pacify automake "gnu"
strictness.  Creates a dummy ChangeLog, that will be overridden
by the proper one at distribution time.
(gen_start_date): New variable, the date starting from which the
git log entries are to be copied in the generated ChangeLog.
(EXTRA_DIST): Add ChangeLog.3 and gitlog-to-changelog.
* configure.ac (AC_CONFIG_SRCDIR): Use 'lib/autoconf/autoconf.m4'
instead of 'ChangeLog' as the sentinel file.
* .gitignore: Add ChangeLog.
  • Loading branch information
slattarini committed Jan 17, 2012
1 parent 46c04f8 commit 6ed5195
Show file tree
Hide file tree
Showing 6 changed files with 400 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.#*
.version
CVS
/ChangeLog
/Fetchdir
/INSTALL
Makefile
Expand Down
File renamed without changes.
22 changes: 20 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ SUBDIRS = bin . lib doc tests man

ACLOCAL_AMFLAGS = -I m4

EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 \
EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
BUGS COPYINGv3 COPYING.EXCEPTION \
GNUmakefile maint.mk cfg.mk \
build-aux/gendocs.sh \
build-aux/git-version-gen \
build-aux/announce-gen build-aux/gnupload \
build-aux/gitlog-to-changelog \
.prev-version .version

## --------- ##
Expand All @@ -48,6 +49,23 @@ $(srcdir)/INSTALL: $(top_srcdir)/doc/install.texi
rm -f tmp.texi
endif

# Generate the ChangeLog from git history.
gen_start_date = 2012-01-15 18:00:00 UTC
.PHONY: gen-ChangeLog
gen-ChangeLog:
if test -d $(top_srcdir)/.git; then \
$(top_srcdir)/build-aux/gitlog-to-changelog \
--since='$(gen_start_date)' > $(distdir)/cl-t \
&& rm -f $(distdir)/ChangeLog \
&& mv $(distdir)/cl-t $(distdir)/ChangeLog; \
fi

# Dummy rule, to pacify automake "gnu" strictness and allow a clean
# bootstrap. Creates a dummy ChangeLog (unless one is already present,
# as might be the case for users of vc-dwim) that will be overridden
# with a proper one at distribution time.
$(srcdir)/ChangeLog:
@echo dummy > $@

# Version string management. There are two files to be aware of:
# .tarball-version - present only in a distribution tarball, and not in
Expand All @@ -69,7 +87,7 @@ $(top_srcdir)/.version:

# Arrange so that .tarball-version appears only in distribution tarballs,
# never in a checked-out repository.
dist-hook:
dist-hook: gen-ChangeLog
echo $(VERSION) > $(distdir)/.tarball-version

# Arrange to remove the symlink to GNUmakefile in VPATH builds.
Expand Down
Loading

0 comments on commit 6ed5195

Please sign in to comment.