maint: Store released ChangeLog entries in git.

* Makefile.am (EXTRA_DIST): Add ChangeLog.2
(gen-ChangeLog): Only include unreleased entries.
(ChangeLog.2): New rule to re-generate file.
This commit is contained in:
Simon Josefsson
2025-01-04 00:24:57 +01:00
parent 5db0a50223
commit 30a6f3cbcd

View File

@@ -18,7 +18,8 @@
ACLOCAL_AMFLAGS = -I am -I m4
EXTRA_DIST = paths ChangeLog.0 ChangeLog.1 summary.sh.in CHECKLIST
EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2
EXTRA_DIST += paths summary.sh.in CHECKLIST
EXTRA_DIST += bootstrap bootstrap.conf bootstrap-funclib.sh
@@ -40,14 +41,34 @@ dist-hook: gen-ChangeLog
.PHONY: gen-ChangeLog
gen-ChangeLog:
$(AM_V_GEN)if test -d .git; then \
$(top_srcdir)/build-aux/gitlog-to-changelog \
-- v2.0~.. > $(distdir)/cl-t && \
{ rm -f $(distdir)/ChangeLog && \
mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
$(AM_V_GEN)if test -e $(srcdir)/.git; then \
LC_ALL=en_US.UTF-8 TZ=UTC0 \
$(top_srcdir)/build-aux/gitlog-to-changelog \
--srcdir=$(srcdir) -- \
v$(PREV_VERSION)~.. > $(distdir)/cl-t && \
{ printf '\nSee ChangeLog.? for older entries\n' \
>> $(distdir)/cl-t && \
rm -f $(distdir)/ChangeLog && \
mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
fi
# dist
CL2START = f70b506e3746bce45d1b684d5ac5ef513af73df4
CL2STR = ' \n Copyright (C) 2021-2025 Free Software Foundation, Inc.\n'
$(srcdir)/ChangeLog.2:
$(AM_V_GEN)if test -e $(srcdir)/.git; then \
LC_ALL=en_US.UTF-8 TZ=UTC0 \
$(top_srcdir)/build-aux/gitlog-to-changelog \
--srcdir=$(srcdir) -- \
$(CL2START)..v$(PREV_VERSION) > cl-t && \
{ printf $(CL2STR) >> cl-t && \
tail -15 ChangeLog.1 >> cl-t && \
if cmp cl-t ChangeLog.2 >/dev/null 2>&1; then \
rm -f cl-t; \
else \
rm -f $(srcdir)/ChangeLog.2; \
mv -f cl-t $(srcdir)/ChangeLog.2; \
fi; } \
fi
dist-hook: mtime-NEWS-to-git-HEAD