[Pkg-gnupg-commit] [libassuan] 368/437: Generate the ChangeLog from commit logs.
Eric Dorland
eric at moszumanska.debian.org
Fri May 22 05:34:05 UTC 2015
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository libassuan.
commit 165a57d29d2ac84159aa48b171b6098c629bc798
Author: Werner Koch <wk at gnupg.org>
Date: Thu Dec 1 22:53:03 2011 +0100
Generate the ChangeLog from commit logs.
* build-aux/gitlog-to-changelog: New script. Taken from gnulib.
* build-aux/git-log-fix: New file.
* build-aux/git-log-footer: New file.
* doc/HACKING: New file.
* ChangeLog: New file.
* Makefile.am (EXTRA_DIST): Add new files.
(gen-ChangeLog): New.
(dist-hook): Run gen-ChangeLog.
* autogen.sh: Install commit-msg hook for git.
Rename all ChangeLog files to ChangeLog-2011.
---
ChangeLog | 446 +---------------------------------
ChangeLog => ChangeLog-2011 | 7 +
Makefile.am | 22 +-
autogen.sh | 7 +
build-aux/git-hooks/commit-msg | 127 ++++++++++
build-aux/git-log-fix | 3 +
build-aux/git-log-footer | 14 ++
build-aux/gitlog-to-changelog | 345 ++++++++++++++++++++++++++
contrib/{ChangeLog => ChangeLog-2011} | 7 +
doc/{ChangeLog => ChangeLog-2011} | 10 +-
doc/HACKING | 25 ++
doc/Makefile.am | 2 +-
src/{ChangeLog => ChangeLog-2011} | 7 +
tests/{ChangeLog => ChangeLog-2011} | 7 +
14 files changed, 590 insertions(+), 439 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ee8e140..34fda85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,438 +1,16 @@
-2011-11-28 Jim Meyering <meyering at redhat.com>
+No more ChangeLog files
+========================
- accept --with-libgpg-error-prefix as well as --with-gpg-error-prefix
- * m4/gpg-error.m4: Update from git master.
+Do not modify any of the ChangeLog files in Libassuan. Starting on
+December 1st, 2011 we put change information only in the GIT commit
+log, and generate a top-level ChangeLog file from logs at "make dist"
+time. As such, there are strict requirements on the form of the
+commit log messages. See doc/HACKING for details. The old ChangeLog
+files have all be renamed to ChangeLog-2011.
-2011-08-10 Werner Koch <wk at g10code.com>
- * configure.ac: Use http://bugs.gnupg.org as bug reporting
- address. Fix new autoconf warnings.
- Update libtool to version 2.4.
-
- * config.guess, config.sub: Update to version 2011-06-03.
-
-2011-06-16 Marcus Brinkmann <marcus at g10code.com>
-
- Release 2.0.2
-
- * configure.ac: Set LT version to C2/A2/R0.
-
-2011-04-20 Werner Koch <wk at g10code.com>
-
- * Makefile.am (EXTRA_DIST): s/README.SVN/README.GIT/
-
-2011-04-06 Werner Koch <wk at g10code.com>
-
- * autogen.sh: Check the git setup. Add option --build-w64.
- * configure.ac (HAVE_W64_SYSTEM): Define.
- (LIBGCRYPT_CONFIG_HOST): New.
-
- * m4/gpg-error.m4: Update from current libgpg-error repo.
-
-2011-03-28 Werner Koch <wk at g10code.com>
-
- * configure.ac (AC_CHECK_HEADERS): Check for sys/select.h which is
- needed by one test utility.
-
-2010-12-23 Werner Koch <wk at g10code.com>
-
- * configure.ac: Add a git commit identifier to the version.
-
-2010-11-01 Marcus Brinkmann <marcus at g10code.de>
-
- * configure.ac: Check for fcntl.h.
-
-2010-11-01 Werner Koch <wk at g10code.com>
-
- * configure.ac: Check for sys/types.h, sys/stat.h, sys/time and
- unistd.h
-
-2010-08-19 Werner Koch <wk at g10code.com>
-
- * configure.ac (AH_TOP, AH_BOTTOM): New. Define
- GPG_ERR_ENABLE_ERRNO_MACROS.
-
-2010-08-09 Werner Koch <wk at g10code.com>
-
- Release 2.0.1
-
- * configure.ac: Set LT version to C1/A1/R0.
-
-2010-04-20 Werner Koch <wk at g10code.com>
-
- * configure.ac: Change wording of the no-funopen warning.
-
-2010-03-22 Werner Koch <wk at g10code.com>
-
- * configure.ac (CC_FOR_BUILD): Add test.
-
-2010-03-17 Werner Koch <wk at g10code.com>
-
- * tests/ChangeLog: New. Move all relevant entries to there.
-
-2010-02-25 Werner Koch <wk at g10code.com>
-
- * m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Fix for non x86 mingw
- targets.
-
-2010-02-11 Werner Koch <wk at g10code.com>
-
- * configure.ac (inet_pton): Check for it.
-
-2010-02-04 Werner Koch <wk at g10code.com>
-
- * configure.ac (AC_TYPE_UINT16_T): New.
-
-2010-01-26 Werner Koch <wk at g10code.com>
-
- * configure.ac (NETLIBS) [W32CE]: Use -lws2.
-
-2010-01-22 Werner Koch <wk at g10code.com>
-
- * configure.ac: Require libgpg-error 1.8.
- (HAVE_W32CE_SYSTEM): New am_defines and am_conditionals.
- * ltmain.sh (wrappers_required): Don't set for mingw32ce.
- * autogen.sh: Add option --build-w32ce. Remove --disable-shared
- from --build-w32.
-
-2010-01-08 Marcus Brinkmann <marcus at g10code.de>
-
- Released 2.0.0.
-
-2010-01-05 Marcus Brinkmann <marcus at g10code.de>
-
- * configure.ac (_DARWIN_C_SOURCE): Define on frapple.
-
-2009-12-22 Marcus Brinkmann <marcus at g10code.de>
-
- * configure.ac: Do not use echo -n.
-
-2009-12-15 Marcus Brinkmann <marcus at g10code.de>
-
- * configure.ac: Bump version to 2.0.0.
-
-2009-10-16 Marcus Brinkmann <marcus at g10code.de>
-
- * autogen.sh: Remove --with-pth-prefix from configure invocation.
- * configure.ac (_ASSUAN_IN_LIBASSUAN, PTH_SYSCALL_SOFT): Do not
- set anymore.
- (GNUPG_PATH_PTH): Don't invoke.
- (HAVE_PTH): Remove conditional.
- (LIBASSUAN_CONFIG_THREAD_MODULES): Removed.
-
-2009-10-08 Marcus Brinkmann <marcus at g10code.de>
-
- * configure.ac: AC_REPLACE_FUNCS for vasprintf.
-
-2009-09-19 Marcus Brinkmann <marcus at g10code.de>
-
- * configure.ac: Check for stdint.h and inttypes.h. Invoke
- AC_TYPE_UINTPTR_T.
-
-2009-09-08 Marcus Brinkmann <marcus at g10code.de>
-
- * m4/gpg-error.m4: New file.
-
-2009-09-01 Marcus Brinkmann <marcus at g10code.de>
-
- * configure.ac: Set BUILD_REVISION and update calculation of data
- for build info. Update libtool macros. Set NETLIBS for W32
- targets.
-
-2009-08-26 Marcus Brinkmann <marcus at g10code.de>
-
- * configure.ac: Test for versioned symbols support.
- (LIBASSUAN_LT_CURRENT, LIBASSUAN_LT_AGE)
- (LIBASSUAN_LT_REVISION): New, set to 0.
- (LIBASSUAN_CONFIG_API_VERSION): Bump to 2.
- (AC_CONFIG_MACRO_DIR, AC_DISABLE_STATIC, AC_LIBTOOL_WIN32_DLL)
- (AC_LIBTOOL_RC, AC_PROG_LIBTOOL, AM_PATH_GPG_ERROR): Invoke.
- (AC_PROG_RANLIB): Don't invoke.
- (HAVE_W32_SYSTEM): New AM conditional.
- (AC_CONFIG_FILES): Add src/versioninfo.rc.
- * ltmain.sh, m4/libtool.m4, m4/ltoptions.m4, m4/ltsugar.m4,
- m4/ltversion.m4, m4/lt~obsolete.m4: New files from libtool 2.2.6.
-
-2009-01-22 Werner Koch <wk at g10code.com>
-
- * configure.ac: Check for nanoleep only in libc.
-
-2008-05-25 Werner Koch <wk at g10code.com>
-
- Released 1.0.5.
-
-2008-05-23 Werner Koch <wk at g10code.com>
-
- * configure.ac: Use -fPIC with GCC under Linux.
-
-2007-12-12 Werner Koch <wk at g10code.com>
-
- Released 1.0.4.
-
- * config.sub, config.guess: Update to version 2007-11-19.
-
-2007-08-24 Werner Koch <wk at g10code.com>
-
- Released 1.0.3.
-
- Switched license of the library code back to LGPLv2.1. See NEWS.
-
- * COPYING.LIB: Replaced by LPGLv2.1
-
-2007-07-05 Werner Koch <wk at g10code.com>
-
- Released 1.0.2.
-
- Relicensed to LGPLv3.
-
- * COPYING: Replaced by GPLv3.
- * COPYING.LESSER: Removed.
- * COPYING.LIB: New.
-
- * Makefile.am (ACLOCAL_AMFLAGS): Do not create gzipped tarball.
-
-2007-07-03 Werner Koch <wk at g10code.com>
-
- * configure.ac (NETLIBS): Use ws2_32 instead of wsock32.
-
-2007-06-15 Werner Koch <wk at g10code.com>
-
- * autogen.sh: Use = and not == in test to be POSIXly correct.
- Change shell back to /bin/sh.
-
-2007-06-15 Marcus Brinkmann <marcus at g10code.de>
-
- * autogen.sh: Require bash.
-
-2007-05-30 Werner Koch <wk at g10code.com>
-
- * autogen.sh <--build-w32>: Modernize.
-
-2007-05-29 Werner Koch <wk at g10code.com>
-
- * configure.ac: Require automake 1.10 and autoconf 2.61.
- (AM_PROG_CC_C_O): New. Error out if no C-89 cc is installed.
- (gl_HEADER_SYS_SOCKET): Explicitly add this for documentation.
-
-2007-05-24 Werner Koch <wk at g10code.com>
-
- * configure.ac: Use -Wpointer-arith is possible.
-
-2006-11-22 Werner Koch <wk at g10code.com>
-
- Released 1.0.1.
-
-2006-11-21 Werner Koch <wk at g10code.com>
-
- * configure.ac (AH_BOTTOM): Define PTH_SYSCALL_SOFT to 0.
- (AC_INIT): Use the SVN magic.
-
- * m4/gnupg-pth.m4 (GNUPG_PTH_VERSION_CHECK): Use --all with
- pth-config.
-
-2006-11-15 Werner Koch <wk at g10code.com>
-
- * autogen.sh: Add convenience option --build-amd64.
-
-2006-10-31 Werner Koch <wk at g10code.com>
-
- Released 1.0.0.
-
-2006-10-20 Werner Koch <wk at g10code.com>
-
- * Makefile.am (stowinstall): New convenience target.
-
-2006-10-10 Werner Koch <wk at g10code.com>
-
- Released 0.9.3.
-
- * configure.ac: Check for cmsghdr.
- (USE_DESCRIPTOR_PASSING): Define it then.
-
-2006-10-09 Werner Koch <wk at g10code.com>
-
- * m4/gnupg-pth.m4: New. Taked from GnuPG.
-
-2006-10-04 Werner Koch <wk at g10code.com>
-
- Released 0.9.2.
-
-2006-10-04 Werner Koch <wk at g10code.com>
-
- Released 0.9.1.
-
- * configure.ac (AB_INIT): New.
-
- * m4/autobuild.m4: New.
-
-2006-09-14 Werner Koch <wk at g10code.com>
-
- Released 0.9.0.
-
- * configure.ac: Check for S_PEERCRED. Include check for socklen_t.
- * m4/sys_socket_h.m4, m4/onceonly.m4, m4/socklen.m4: New.
- * m4/Makefile.am: New.
-
-2006-09-05 Werner Koch <wk at g10code.com>
-
- * configure.ac (AH_BOTTOM): Define _ASSUAN_IN_LIBASSUAN.
-
-2005-10-24 Werner Koch <wk at g10code.com>
-
- * COPYING.LESSER: Added.
- * README.CVS: Renamed to ..
- * README.SVN: .. this.
-
-2005-10-08 Marcus Brinkmann <marcus at g10code.de>
-
- * configure.ac: Check for socket library and add it to
- LIBASSUAN_CONFIG_LIBS if necessary.
-
-2005-10-07 Marcus Brinkmann <marcus at g10code.de>
-
- * configure.ac: Invoke AC_CANONICAL_HOST. Define _XOPEN_SOURCE,
- _XOPEN_SOURCE_EXTENDED and __EXTENSIONS__ on Solaris.
- Add stpcy as replacement function.
- Add setenv as replacement function (and check for unistd.h).
-
-2005-06-20 Werner Koch <wk at g10code.com>
-
- Released 0.6.10.
-
-2004-12-22 Werner Koch <wk at g10code.com>
-
- Released 0.6.9.
-
- For security reasons switched to automake 1.9.
-
-2004-12-18 Werner Koch <wk at g10code.com>
-
- * autogen.sh: Add Option --build-w32.
-
-2004-12-07 Werner Koch <wk at g10code.com>
-
- * configure.ac: Define HAVE_W32_SYSTEM and HAVE_DOSISH_SYSTEM.
- Add -lwsock2 to the config lib flags for W32.
-
-2004-11-25 Werner Koch <wk at g10code.com>
-
- Released 0.6.8.
-
-2004-09-27 Werner Koch <wk at g10code.com>
-
- * config.sub, config.guess: Updated.
-
-2004-06-23 Marcus Brinkmann <marcus at g10code.de>
-
- * configure.ac: Check for <sys/uio.h>.
-
-2004-06-08 Werner Koch <wk at gnupg.org>
-
- Released 0.6.6.
-
-2004-04-02 Thomas Schwinge <schwinge at nic-nac-project.de>
-
- * autogen.sh: Added ACLOCAL_FLAGS.
-
-2004-02-20 Werner Koch <wk at gnupg.org>
-
- Released 0.6.4.
-
-2004-02-11 Werner Koch <wk at gnupg.org>
-
- * autogen.sh (check_version): Removed bashism and simplified.
-
-2004-01-29 Werner Koch <wk at gnupg.org>
-
- Released 0.6.3.
-
-2003-12-18 Werner Koch <wk at gnupg.org>
-
- Released 0.6.2.
-
-2003-12-08 Werner Koch <wk at gnupg.org>
-
- * TODO: New.
- * Makefile.am: Add README.CVS and autogen.sh. Removed m4/Makefile.
- * README.CVS: New.
- * autogen.sh: Revamped.
- * configure.ac: Add automake version number for autogen.sh use.
-
-2003-11-17 Werner Koch <wk at gnupg.org>
-
- Released 0.6.1.
-
-2003-08-06 Werner Koch <wk at gnupg.org>
-
- Released 0.6.0.
-
-2003-07-29 Werner Koch <wk at gnupg.org>
-
- * configure.ac: Cleanups for newer autoconf.
-
-2003-07-29 gettextize <bug-gnu-gettext at gnu.org>
-
- * Makefile.am (EXTRA_DIST): Add config.rpath.
- * configure.ac (AC_CONFIG_FILES): Add po/Makefile.in,
-
-2003-04-28 gettextize <bug-gnu-gettext at gnu.org>
-
- * Makefile.am (SUBDIRS): Add m4.
- (ACLOCAL_AMFLAGS): New variable.
- (EXTRA_DIST): New variable.
- * configure.ac (AC_CONFIG_FILES): Add po/Makefile.in,
-
-2003-02-18 Neal H. Walfield <neal at g10code.de>
-
- * COPYING: New file.
-
-2003-02-18 Neal H. Walfield <neal at g10code.de>
-
- * configure.ac: Fix typo.
- (AC_CONFIG_FILES): Remove common/Makefile.am.
- * common: Remove directory.
-
-2003-02-18 Neal H. Walfield <neal at g10code.de>
-
- * common: New directory.
- * Makefile.am (SUBDIRS): Add common.
-
- * configure.ac: Check for funopen. If not present, check for
- fopencookie and implement it in terms of that. Otherwise, fail.
- (AC_CONFIG_FILES): Add common/Makefile.
-
-2003-02-18 Neal H. Walfield <neal at g10code.de>
-
- * configure.ac (AC_CONFIG_FILES): Add src/libassuan-config.
- (LIBASSUAN_CONFIG_LIBS, LIBASSUAN_CONFIG_CFLAGS): New variables.
- AC_SUBST them.
-
-2003-02-17 Neal H. Walfield <neal at g10code.de>
-
- * AUTHORS: New file.
- * INSTALL: New file.
- * Makefile.am: New file.
- * NEWS: New file.
- * README: New file.
- * autogen.sh: New file, copied from newpg.
- * configure.ac: New file, imported from newpg.
- * depcomp: New file.
- * install-sh: New file.
- * missing: New file.
- * mkinstalldirs: New file.
-
- * doc: New directory.
- * src: New directory.
- * tests: New directory.
-
-
- Copyright 2003, 2004, 2005, 2006, 2007, 2010 Free Software Foundation, Inc.
-
- This file is free software; as a special exception the author gives
- unlimited permission to copy and/or distribute it, with or without
- modifications, as long as this notice is preserved.
-
- This file is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+Local Variables:
+buffer-read-only: t
+mode: text
+End:
diff --git a/ChangeLog b/ChangeLog-2011
similarity index 97%
copy from ChangeLog
copy to ChangeLog-2011
index ee8e140..f8a5dfc 100644
--- a/ChangeLog
+++ b/ChangeLog-2011
@@ -1,3 +1,10 @@
+2011-12-01 Werner Koch <wk at g10code.com>
+
+ NB: ChangeLog files are no longer manually maintained. Starting
+ on December 1st, 2011 we put change information only in the GIT
+ commit log, and generate a top-level ChangeLog file from logs at
+ "make dist". See doc/HACKING for details.
+
2011-11-28 Jim Meyering <meyering at redhat.com>
accept --with-libgpg-error-prefix as well as --with-gpg-error-prefix
diff --git a/Makefile.am b/Makefile.am
index 55040e7..e7eeee5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,14 +21,32 @@
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip
-EXTRA_DIST = config.rpath autogen.sh README.GIT
+EXTRA_DIST = config.rpath autogen.sh README.GIT \
+ ChangeLog-2011 doc/ChangeLog-2011 src/ChangeLog-2011 \
+ tests/ChangeLog-2011 contrib/ChangeLog-2011 \
+ build-aux/gitlog-to-changelog build-aux/git-log-footer \
+ build-aux/git-log-fix
SUBDIRS = m4 src doc tests
-dist-hook:
+dist-hook: gen-ChangeLog
echo "$(VERSION)" > $(distdir)/VERSION
+gen_start_date = 2011-12-01T00:00:00
+.PHONY: gen-ChangeLog
+gen-ChangeLog:
+ if test -d $(top_srcdir)/.git; then \
+ (cd $(top_srcdir) && \
+ ./build-aux/gitlog-to-changelog \
+ --amend=build-aux/git-log-fix \
+ --since=$(gen_start_date) ) > $(distdir)/cl-t; \
+ cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;\
+ rm -f $(distdir)/ChangeLog; \
+ mv $(distdir)/cl-t $(distdir)/ChangeLog; \
+ fi
+
+
stowinstall:
$(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/libassuan
diff --git a/autogen.sh b/autogen.sh
index 30a247a..42e00d5 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -261,6 +261,13 @@ EOF
cp -av .git/hooks/pre-commit.sample .git/hooks/pre-commit
chmod -c +x .git/hooks/pre-commit
fi
+ if [ -f build-aux/git-hooks/commit-msg -a ! -f .git/hooks/commit-msg ] ; then
+ cat <<EOF >&2
+*** Activating commit log message check hook. ***
+EOF
+ cp -av build-aux/git-hooks/commit-msg .git/hooks/commit-msg
+ chmod -c +x .git/hooks/commit-msg
+ fi
fi
diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-msg
new file mode 100755
index 0000000..5a697c7
--- /dev/null
+++ b/build-aux/git-hooks/commit-msg
@@ -0,0 +1,127 @@
+eval '(exit $?0)' && eval 'exec perl -w "$0" ${1+"$@"}'
+ & eval 'exec perl -w "$0" $argv:q'
+ if 0;
+
+# An hook script to check the commit log message.
+# Called by "git commit" with one argument, the name of the file
+# that has the commit message. The hook should exit with non-zero
+# status after issuing an appropriate message if it wants to stop the
+# commit. The hook is allowed to edit the commit message file.
+#
+# To enable this hook, copy it to "~/.git/hooks/commit-msg".
+#
+# This script is based on the one from GNU coreutils.
+
+use strict;
+use warnings;
+(my $ME = $0) =~ s|.*/||;
+
+my $editor = $ENV{EDITOR} || 'vi';
+$ENV{PATH} = '/bin:/usr/bin';
+
+# Rewrite the $LOG_FILE (old contents in @$LINE_REF) with an additional
+# commented diagnostic "# $ERR" line at the top.
+sub rewrite($$$)
+{
+ my ($log_file, $err, $line_ref) = @_;
+ local *LOG;
+ open LOG, '>', $log_file
+ or die "$ME: $log_file: failed to open for writing: $!";
+ print LOG "# $err";
+ print LOG @$line_ref;
+ close LOG
+ or die "$ME: $log_file: failed to rewrite: $!\n";
+}
+
+sub re_edit($)
+{
+ my ($log_file) = @_;
+
+ warn "Interrupt (Ctrl-C) to abort...\n";
+
+ system 'sh', '-c', "$editor $log_file";
+ ($? & 127) || ($? >> 8)
+ and die "$ME: $log_file: the editor ($editor) failed, aborting\n";
+}
+
+# Given a $LOG_FILE name and a \@LINE buffer,
+# read the contents of the file into the buffer and analyze it.
+# If the log message passes muster, return the empty string.
+# If not, return a diagnostic.
+sub check_msg($$)
+{
+ my ($log_file, $line_ref) = @_;
+
+ local *LOG;
+ open LOG, '<', $log_file
+ or return "failed to open for reading: $!";
+ @$line_ref = <LOG>;
+ close LOG;
+
+ my @line = @$line_ref;
+ chomp @line;
+
+ # Don't filter out blank or comment lines; git does that already,
+ # and if we were to ignore them here, it could lead to committing
+ # with lines that start with "#" in the log.
+
+ # Filter out leading blank and comment lines.
+ # while (@line && $line[0] =~ /^(?:#.*|[ \t]*)$/) { shift @line; }
+
+ # Filter out blank and comment lines at EOF.
+ # while (@line && $line[$#line] =~ /^(?:#.*|[ \t]*)$/) { pop @line; }
+
+ @line == 0
+ and return 'no log message';
+
+ # The first line should not be too short
+ 8 < length $line[0] || return 'summary line too short';
+
+ # The first line should not start with an asterisk or a hash sign.
+ # An asterisk might indicate that a change entry was started right
+ # at the first line.
+ $line[0] =~ /^[*#]/ && return "summary line starts with an * or #";
+
+ # Second line should be blank or not present.
+ 2 <= @line && length $line[1]
+ and return 'second line must be empty';
+
+ # Limit line length to allow for the ChangeLog's leading TAB.
+ foreach my $line (@line)
+ {
+ 72 < length $line && $line =~ /^[^#]/
+ and return 'line longer than 72 characters';
+ }
+
+ return '';
+}
+
+{
+ @ARGV == 1
+ or die;
+
+ my $log_file = $ARGV[0];
+
+ while (1)
+ {
+ my @line;
+ my $err = check_msg $log_file, \@line;
+ $err eq ''
+ and last;
+ $err = "$ME: $err\n";
+ warn $err;
+ exit 1;
+
+ # Insert the diagnostic as a comment on the first line of $log_file.
+ #rewrite $log_file, $err, \@line;
+ #re_edit $log_file;
+ #
+ ## Stop if our parent is killed.
+ #getppid() == 1
+ # and last;
+ }
+}
+
+# Local Variables:
+# mode: perl
+# End:
diff --git a/build-aux/git-log-fix b/build-aux/git-log-fix
new file mode 100644
index 0000000..af702fe
--- /dev/null
+++ b/build-aux/git-log-fix
@@ -0,0 +1,3 @@
+# 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.
diff --git a/build-aux/git-log-footer b/build-aux/git-log-footer
new file mode 100644
index 0000000..c31fe93
--- /dev/null
+++ b/build-aux/git-log-footer
@@ -0,0 +1,14 @@
+
+2011-12-01 Werner Koch <wk at gnupg.org>
+
+ NB: Changes done before December 1st, 2011 are described in
+ per directory files named ChangeLog-2011. See doc/HACKING for
+ details.
+
+ -----
+ Copyright (C) 2011 Free Software Foundation, Inc.
+
+ Copying and distribution of this file and/or the original GIT
+ commit log messages, with or without modification, are
+ permitted provided the copyright notice and this notice are
+ preserved.
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
new file mode 100755
index 0000000..40a8035
--- /dev/null
+++ b/build-aux/gitlog-to-changelog
@@ -0,0 +1,345 @@
+eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
+ & eval 'exec perl -wS "$0" $argv:q'
+ if 0;
+# Convert git log output to ChangeLog format.
+
+my $VERSION = '2011-11-02 07:53'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job. Otherwise, update this string manually.
+
+# Copyright (C) 2008-2011 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Written by Jim Meyering
+
+use strict;
+use warnings;
+use Getopt::Long;
+use POSIX qw(strftime);
+
+(my $ME = $0) =~ s|.*/||;
+
+# use File::Coda; # http://meyering.net/code/Coda/
+END {
+ defined fileno STDOUT or return;
+ close STDOUT and return;
+ warn "$ME: failed to close standard output: $!\n";
+ $? ||= 1;
+}
+
+sub usage ($)
+{
+ my ($exit_code) = @_;
+ my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
+ if ($exit_code != 0)
+ {
+ print $STREAM "Try `$ME --help' for more information.\n";
+ }
+ else
+ {
+ print $STREAM <<EOF;
+Usage: $ME [OPTIONS] [ARGS]
+
+Convert git log output to ChangeLog format. If present, any ARGS
+are passed to "git log". To avoid ARGS being parsed as options to
+$ME, they may be preceded by '--'.
+
+OPTIONS:
+
+ --amend=FILE FILE maps from an SHA1 to perl code (i.e., s/old/new/) that
+ makes a change to SHA1's commit log text or metadata.
+ --append-dot append a dot to the first line of each commit message if
+ there is no other punctuation or blank at the end.
+ --since=DATE convert only the logs since DATE;
+ the default is to convert all log entries.
+ --format=FMT set format string for commit subject and body;
+ see 'man git-log' for the list of format metacharacters;
+ the default is '%s%n%b%n'
+
+ --help display this help and exit
+ --version output version information and exit
+
+EXAMPLE:
+
+ $ME --since=2008-01-01 > ChangeLog
+ $ME -- -n 5 foo > last-5-commits-to-branch-foo
+
+In a FILE specified via --amend, comment lines (starting with "#") are ignored.
+FILE must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 (alone on
+a line) referring to a commit in the current project, and CODE refers to one
+or more consecutive lines of Perl code. Pairs must be separated by one or
+more blank line.
+
+Here is sample input for use with --amend=FILE, from coreutils:
+
+3a169f4c5d9159283548178668d2fae6fced3030
+# fix typo in title:
+s/all tile types/all file types/
+
+1379ed974f1fa39b12e2ffab18b3f7a607082202
+# Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself.
+# Change the author to be Paul. Note the escaped "@":
+s,Jim .*>,Paul Eggert <eggert\@cs.ucla.edu>,
+
+EOF
+ }
+ exit $exit_code;
+}
+
+# If the string $S is a well-behaved file name, simply return it.
+# If it contains white space, quotes, etc., quote it, and return the new string.
+sub shell_quote($)
+{
+ my ($s) = @_;
+ if ($s =~ m![^\w+/.,-]!)
+ {
+ # Convert each single quote to '\''
+ $s =~ s/\'/\'\\\'\'/g;
+ # Then single quote the string.
+ $s = "'$s'";
+ }
+ return $s;
+}
+
+sub quoted_cmd(@)
+{
+ return join (' ', map {shell_quote $_} @_);
+}
+
+# Parse file F.
+# Comment lines (starting with "#") are ignored.
+# F must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1
+# (alone on a line) referring to a commit in the current project, and
+# CODE refers to one or more consecutive lines of Perl code.
+# Pairs must be separated by one or more blank line.
+sub parse_amend_file($)
+{
+ my ($f) = @_;
+
+ open F, '<', $f
+ or die "$ME: $f: failed to open for reading: $!\n";
+
+ my $fail;
+ my $h = {};
+ my $in_code = 0;
+ my $sha;
+ while (defined (my $line = <F>))
+ {
+ $line =~ /^\#/
+ and next;
+ chomp $line;
+ $line eq ''
+ and $in_code = 0, next;
+
+ if (!$in_code)
+ {
+ $line =~ /^([0-9a-fA-F]{40})$/
+ or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
+ $fail = 1, next;
+ $sha = lc $1;
+ $in_code = 1;
+ exists $h->{$sha}
+ and (warn "$ME: $f:$.: duplicate SHA1\n"),
+ $fail = 1, next;
+ }
+ else
+ {
+ $h->{$sha} ||= '';
+ $h->{$sha} .= "$line\n";
+ }
+ }
+ close F;
+
+ $fail
+ and exit 1;
+
+ return $h;
+}
+
+{
+ my $since_date;
+ my $format_string = '%s%n%b%n';
+ my $amend_file;
+ my $append_dot = 0;
+ GetOptions
+ (
+ help => sub { usage 0 },
+ version => sub { print "$ME version $VERSION\n"; exit },
+ 'since=s' => \$since_date,
+ 'format=s' => \$format_string,
+ 'amend=s' => \$amend_file,
+ 'append-dot' => \$append_dot,
+ ) or usage 1;
+
+
+ defined $since_date
+ and unshift @ARGV, "--since=$since_date";
+
+ # This is a hash that maps an SHA1 to perl code (i.e., s/old/new/)
+ # that makes a correction in the log or attribution of that commit.
+ my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {};
+
+ my @cmd = (qw (git log --log-size),
+ '--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV);
+ open PIPE, '-|', @cmd
+ or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n"
+ . "(Is your Git too old? Version 1.5.1 or later is required.)\n");
+
+ my $prev_date_line = '';
+ my @prev_coauthors = ();
+ while (1)
+ {
+ defined (my $in = <PIPE>)
+ or last;
+ $in =~ /^log size (\d+)$/
+ or die "$ME:$.: Invalid line (expected log size):\n$in";
+ my $log_nbytes = $1;
+
+ my $log;
+ my $n_read = read PIPE, $log, $log_nbytes;
+ $n_read == $log_nbytes
+ or die "$ME:$.: unexpected EOF\n";
+
+ # Extract leading hash.
+ my ($sha, $rest) = split ':', $log, 2;
+ defined $sha
+ or die "$ME:$.: malformed log entry\n";
+ $sha =~ /^[0-9a-fA-F]{40}$/
+ or die "$ME:$.: invalid SHA1: $sha\n";
+
+ # If this commit's log requires any transformation, do it now.
+ my $code = $amend_code->{$sha};
+ if (defined $code)
+ {
+ eval 'use Safe';
+ my $s = new Safe;
+ # Put the unpreprocessed entry into "$_".
+ $_ = $rest;
+
+ # Let $code operate on it, safely.
+ my $r = $s->reval("$code")
+ or die "$ME:$.:$sha: failed to eval \"$code\":\n$@\n";
+
+ # Note that we've used this entry.
+ delete $amend_code->{$sha};
+
+ # Update $rest upon success.
+ $rest = $_;
+ }
+
+ my @line = split "\n", $rest;
+ my $author_line = shift @line;
+ defined $author_line
+ or die "$ME:$.: unexpected EOF\n";
+ $author_line =~ /^(\d+) (.*>)$/
+ or die "$ME:$.: Invalid line "
+ . "(expected date/author/email):\n$author_line\n";
+
+ my $date_line = sprintf "%s $2\n", strftime ("%F", localtime ($1));
+
+ # Format 'Co-authored-by: A U Thor <email at example.com>' lines in
+ # standard multi-author ChangeLog format.
+ my @coauthors = grep /^Co-authored-by:.*$/, @line;
+ for (@coauthors)
+ {
+ s/^Co-authored-by:\s*/\t /;
+ s/\s*</ </;
+
+ /<.*?@.*\..*>/
+ or warn "$ME: warning: missing email address for "
+ . substr ($_, 5) . "\n";
+ }
+
+ # If this header would be the same as the previous date/name/email/
+ # coauthors header, then arrange not to print it.
+ if ($date_line ne $prev_date_line or "@coauthors" ne "@prev_coauthors")
+ {
+ $prev_date_line eq ''
+ or print "\n";
+ print $date_line;
+ @coauthors
+ and print join ("\n", @coauthors), "\n";
+ }
+ $prev_date_line = $date_line;
+ @prev_coauthors = @coauthors;
+
+ # Omit "Co-authored-by..." and "Signed-off-by..." lines.
+ @line = grep !/^Signed-off-by: .*>$/, @line;
+ @line = grep !/^Co-authored-by: /, @line;
+
+ # Remove leading and trailing blank lines.
+ if (@line)
+ {
+ while ($line[0] =~ /^\s*$/) { shift @line; }
+ while ($line[$#line] =~ /^\s*$/) { pop @line; }
+ }
+
+ # If there were any lines
+ if (@line == 0)
+ {
+ warn "$ME: warning: empty commit message:\n $date_line\n";
+ }
+ else
+ {
+ if ($append_dot)
+ {
+ # If the first line of the message has enough room, then
+ if (length $line[0] < 72)
+ {
+ # append a dot if there is no other punctuation or blank
+ # at the end.
+ $line[0] =~ /[[:punct:]\s]$/
+ or $line[0] .= '.';
+ }
+ }
+
+ # Prefix each non-empty line with a TAB.
+ @line = map { length $_ ? "\t$_" : '' } @line;
+
+ print "\n", join ("\n", @line), "\n";
+ }
+
+ defined ($in = <PIPE>)
+ or last;
+ $in ne "\n"
+ and die "$ME:$.: unexpected line:\n$in";
+ }
+
+ close PIPE
+ or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
+ # FIXME-someday: include $PROCESS_STATUS in the diagnostic
+
+ # Complain about any unused entry in the --amend=F specified file.
+ my $fail = 0;
+ foreach my $sha (keys %$amend_code)
+ {
+ warn "$ME:$amend_file: unused entry: $sha\n";
+ $fail = 1;
+ }
+
+ exit $fail;
+}
+
+# Local Variables:
+# mode: perl
+# indent-tabs-mode: nil
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "my $VERSION = '"
+# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "'; # UTC"
+# End:
diff --git a/contrib/ChangeLog b/contrib/ChangeLog-2011
similarity index 67%
rename from contrib/ChangeLog
rename to contrib/ChangeLog-2011
index 2d2c7b6..65306e3 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog-2011
@@ -1,3 +1,10 @@
+2011-12-01 Werner Koch <wk at g10code.com>
+
+ NB: ChangeLog files are no longer manually maintained. Starting
+ on December 1st, 2011 we put change information only in the GIT
+ commit log, and generate a top-level ChangeLog file from logs at
+ "make dist". See doc/HACKING for details.
+
2010-11-15 Marcus Brinkmann <mb at g10code.com>
* conf-w32ce-msc/stdint.h: New file.
diff --git a/doc/ChangeLog b/doc/ChangeLog-2011
similarity index 92%
rename from doc/ChangeLog
rename to doc/ChangeLog-2011
index 5e1e198..4f8b568 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog-2011
@@ -1,3 +1,10 @@
+2011-12-01 Werner Koch <wk at g10code.com>
+
+ NB: ChangeLog files are no longer manually maintained. Starting
+ on December 1st, 2011 we put change information only in the GIT
+ commit log, and generate a top-level ChangeLog file from logs at
+ "make dist". See doc/HACKING for details.
+
2009-12-08 Marcus Brinkmann <marcus at g10code.de>
* assuan.texi: Use our own copy of the setfont macro, as it takes
@@ -100,7 +107,7 @@
2007-07-05 Werner Koch <wk at g10code.com>
- * lgpl.texi: New. Taken from COPYING.LIB and reformatted.
+ * lgpl.texi: New. Taken from COPYING.LIB and reformatted.
* gpl.texi: Updated to v3.
* assuan.texi (Utilities): Explain ASSUAN_CONFIDENTIAL.
@@ -145,4 +152,3 @@
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
diff --git a/doc/HACKING b/doc/HACKING
new file mode 100644
index 0000000..b7d6b10
--- /dev/null
+++ b/doc/HACKING
@@ -0,0 +1,25 @@
+# HACKING -*- org -*-
+#+TITLE: Hacking notes for Libassuan
+#+STARTUP: showall
+
+* No more ChangeLog files
+
+ Do not modify any of the ChangeLog files in Libassuan. Starting
+ on December 1st, 2011 we put change information only in the GIT
+ commit log, and generate a top-level ChangeLog file from logs at
+ "make dist" time. As such, there are strict requirements on the
+ form of the commit log messages. The old ChangeLog files have all
+ be renamed to ChangeLog-2011
+
+
+* Commit log requirements
+
+ Your commit log should always start with a one-line summary, the
+ second line should be blank, and the remaining lines are usually
+ ChangeLog-style entries for all affected files. However, it's fine
+ -- even recommended -- to write a few lines of prose describing the
+ change, when the summary and ChangeLog entries don't give enough of
+ the big picture. Omit the leading TABs that you're used to seeing
+ in a "real" ChangeLog file, but keep the maximum line length at 72
+ or smaller, so that the generated ChangeLog lines, each with its
+ leading TAB, will not exceed 80 columns.
diff --git a/doc/Makefile.am b/doc/Makefile.am
index daea6e0..cc41a78 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -18,7 +18,7 @@
## Process this file with automake to produce Makefile.in
-EXTRA_DIST = README.apichanges
+EXTRA_DIST = README.apichanges HACKING
info_TEXINFOS = assuan.texi
diff --git a/src/ChangeLog b/src/ChangeLog-2011
similarity index 99%
rename from src/ChangeLog
rename to src/ChangeLog-2011
index ddbad5e..2f32ea2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog-2011
@@ -1,3 +1,10 @@
+2011-12-01 Werner Koch <wk at g10code.com>
+
+ NB: ChangeLog files are no longer manually maintained. Starting
+ on December 1st, 2011 we put change information only in the GIT
+ commit log, and generate a top-level ChangeLog file from logs at
+ "make dist". See doc/HACKING for details.
+
2011-08-10 Werner Koch <wk at g10code.com>
* assuan.h.in (ASSUAN_FORCE_CLOSE): New.
diff --git a/tests/ChangeLog b/tests/ChangeLog-2011
similarity index 87%
rename from tests/ChangeLog
rename to tests/ChangeLog-2011
index 8d402ad..e2a3a63 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog-2011
@@ -1,3 +1,10 @@
+2011-12-01 Werner Koch <wk at g10code.com>
+
+ NB: ChangeLog files are no longer manually maintained. Starting
+ on December 1st, 2011 we put change information only in the GIT
+ commit log, and generate a top-level ChangeLog file from logs at
+ "make dist". See doc/HACKING for details.
+
2011-03-28 Werner Koch <wk at g10code.com>
* ce-server.c: Include sys/select.h if needed. Fixes bug#1328.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/libassuan.git
More information about the Pkg-gnupg-commit
mailing list