Skip to content

Commit 5ef4a3c

Browse files
author
Jim Meyering
committed
maint: generate ChangeLog from git log
* Makefile.am (gen-ChangeLog): New rule. (dist-hook): Depend on it. (EXTRA_DIST): Distribute the two ChangeLog-* files. * bootstrap.conf (gnulib_modules): Add gitlog-to-changelog. (bootstrap_post_import_hook): Ensure that ChangeLog exists. * build-aux/git-log-fix: New file. * ChangeLog-2012: Renamed ... * ChangeLog: ... from this. * ChangeLog-1998: Renamed ... * OChangeLog: ...from this * .gitignore: Add ChangeLog.
1 parent 4aa9d1f commit 5ef4a3c

7 files changed

+24
-8
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*.cache
32
/*.flc
43
/*.prj
@@ -7,6 +6,7 @@
76
/.version
87
/ABOUT-NLS
98
/COPYING
9+
/ChangeLog
1010
/GNUmakefile
1111
/INSTALL
1212
/Makefile
@@ -31,4 +31,3 @@
3131
/patches
3232
/releases
3333
/stamp-h*
34-

OChangeLog ChangeLog-1998

File renamed without changes.

ChangeLog ChangeLog-2012

File renamed without changes.

Makefile.am

+14-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ aclocaldir = @aclocaldir@
2727
aclocal_DATA = m4/bison-i18n.m4
2828

2929
EXTRA_DIST = .prev-version .version \
30-
cfg.mk \
31-
OChangeLog PACKAGING
30+
cfg.mk ChangeLog-1998 ChangeLog-2012 PACKAGING
3231

3332
# Initialization before completion by local.mk's.
3433
AM_CFLAGS = $(WARN_CFLAGS)
@@ -62,7 +61,7 @@ include tests/local.mk
6261
BUILT_SOURCES += $(top_srcdir)/.version
6362
$(top_srcdir)/.version: configure
6463
echo $(VERSION) > $@-t && mv $@-t $@
65-
dist-hook:
64+
dist-hook: gen-ChangeLog
6665
echo $(VERSION) > $(distdir)/.tarball-version
6766

6867
.PHONY: update-b4-copyright update-package-copyright-year
@@ -73,3 +72,15 @@ update-b4-copyright:
7372
@echo 'warning: src/parse-gram.[hc] may need to be regenerated.'
7473
update-package-copyright-year:
7574
$(build_aux)/$@ configure.ac
75+
76+
gen_start_date = 2012-01-16
77+
.PHONY: gen-ChangeLog
78+
gen-ChangeLog:
79+
$(AM_V_GEN)if test -d .git; then \
80+
$(top_srcdir)/build-aux/gitlog-to-changelog \
81+
--no-cluster \
82+
--amend=$(srcdir)/build-aux/git-log-fix \
83+
--since=$(gen_start_date) > $(distdir)/cl-t; \
84+
rm -f $(distdir)/ChangeLog; \
85+
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
86+
fi

bootstrap.conf

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
gnulib_modules='
2020
announce-gen argmatch assert calloc-posix close config-h c-strcase
2121
configmake dirname error extensions fdl fopen-safer gendocs getopt-gnu
22-
gettext git-version-gen gpl-3.0 hash inttypes isnan javacomp-script
22+
gettext git-version-gen gitlog-to-changelog
23+
gpl-3.0 hash inttypes isnan javacomp-script
2324
javaexec-script ldexpl maintainer-makefile malloc-gnu mbschr mbsrchr
2425
mbswidth obstack perror pipe-posix quote quotearg realloc-posix
2526
spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
@@ -66,6 +67,9 @@ bootstrap_post_import_hook()
6667
{
6768
# Massage lib/gnulib.mk before using it later in the bootstrapping process.
6869
etc/prefix-gnulib-mk lib/$gnulib_mk
70+
71+
# Ensure that ChangeLog exists, for automake.
72+
test -f ChangeLog || touch ChangeLog
6973
}
7074

7175
bootstrap_epilogue()

build-aux/.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/announce-gen
32
/arg-nonnull.h
43
/c++defs.h
@@ -9,6 +8,7 @@
98
/depcomp
109
/gendocs.sh
1110
/git-version-gen
11+
/gitlog-to-changelog
1212
/install-sh
1313
/javacomp.sh.in
1414
/javaexec.sh.in
@@ -21,4 +21,3 @@
2121
/vc-list-files
2222
/warn-on-use.h
2323
/ylwrap
24-

build-aux/git-log-fix

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This file is expected to be used via gitlog-to-changelog's --amend=FILE
2+
# option. It specifies what changes to make to each given SHA1's commit
3+
# log and metadata, using Perl-eval'able expressions.

0 commit comments

Comments
 (0)