From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#19113: Generate a ChangeLog file from commit logs Date: Wed, 19 Nov 2014 15:57:41 -0800 Organization: UCLA Computer Science Department Message-ID: <546D2E75.6090701@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080602050405000107040906" X-Trace: ger.gmane.org 1416441562 20072 80.91.229.3 (19 Nov 2014 23:59:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Nov 2014 23:59:22 +0000 (UTC) To: 19113@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 20 00:59:17 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XrF9Z-0004sd-65 for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Nov 2014 00:59:17 +0100 Original-Received: from localhost ([::1]:32967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrF9Y-0007g6-Se for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Nov 2014 18:59:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrF9P-0007fz-MM for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 18:59:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrF9L-0004Gq-3Z for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 18:59:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrF9K-0004Gl-V2 for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 18:59:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XrF9K-0001xH-LS for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 18:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Nov 2014 23:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19113 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: Emacs bug reports and feature requests Original-Received: via spool by submit@debbugs.gnu.org id=B.14164414997456 (code B ref -1); Wed, 19 Nov 2014 23:59:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Nov 2014 23:58:19 +0000 Original-Received: from localhost ([127.0.0.1]:38817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrF8a-0001wA-TA for submit@debbugs.gnu.org; Wed, 19 Nov 2014 18:58:19 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54634) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrF8W-0001vy-HM for submit@debbugs.gnu.org; Wed, 19 Nov 2014 18:58:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrF8R-00045R-Kd for submit@debbugs.gnu.org; Wed, 19 Nov 2014 18:58:12 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:43995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrF8R-00045L-Gs for submit@debbugs.gnu.org; Wed, 19 Nov 2014 18:58:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrF8N-0007aZ-0I for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 18:58:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrF8I-00044n-Kz for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 18:58:02 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:49037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrF8I-00044K-4X for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 18:57:58 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id C44ACA600DF for ; Wed, 19 Nov 2014 15:57:49 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dseqekjvbAti for ; Wed, 19 Nov 2014 15:57:45 -0800 (PST) Original-Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 71D78A600DE for ; Wed, 19 Nov 2014 15:57:45 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96294 This is a multi-part message in MIME format. --------------080602050405000107040906 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Tags: patch Attached are two patches to change the Emacs repository so that the distributed ChangeLog file is generated automatically from commit logs, instead of being maintained manually. The first patch renames every ChangeLog file to ChangeLog.1 (or whatever) to get it out of the way -- that is, all existing ChangeLog files are retained in the repository as before. The second patch arranges for the new ChangeLog file to be generated automatically from future commit messages. The idea is that developers should continue to write commit messages in ChangeLog style, so the automatic generation is straightforward, but they needn't record their commit messages in ChangeLog files. This approach was developed by Jim Meyering is used by several other GNU packages. This is a first cut, and no doubt could be improved for Emacs, but I thought I'd start the ball rolling by publishing something that works for me. These patches are relative to emacs-24 commit cd2e816 <2014-11-19T19:29:40Z!eggert@cs.ucla.edu>. PS. The first patch would be about 12 MB, so I'm attaching an abbreviated summary of it instead of the actual patch; it can be reproduced using the summary's recipe. --------------080602050405000107040906 Content-Type: text/x-diff; name="0001-Rename-old-ChangeLog-files-to-prepare-for-gitlog-to-.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Rename-old-ChangeLog-files-to-prepare-for-gitlog-to-.pa"; filename*1="tch" >From 5548379456ab22278511262e96f7938e24878e1f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 18 Nov 2014 20:27:43 -0800 Subject: [PATCH 1/2] Rename old ChangeLog files to prepare for gitlog-to-changelog. --- ChangeLog | 13646 ------------------ ChangeLog.1 | 13646 ++++++++++++++++++ admin/ChangeLog | 2267 --- admin/ChangeLog.1 | 2267 +++ doc/emacs/ChangeLog | 10750 --------------- doc/emacs/ChangeLog.1 | 10750 +++++++++++++++ doc/lispintro/ChangeLog | 763 -- doc/lispintro/ChangeLog.1 | 763 ++ doc/lispref/ChangeLog | 13400 ------------------ doc/lispref/ChangeLog.1 | 13400 ++++++++++++++++++ doc/man/ChangeLog | 183 - doc/man/ChangeLog.1 | 183 + doc/misc/ChangeLog | 11781 ---------------- doc/misc/ChangeLog.1 | 11781 ++++++++++++++++ etc/ChangeLog | 6547 --------- etc/ChangeLog.1 | 6547 +++++++++ leim/ChangeLog | 2557 ---- leim/ChangeLog.1 | 2557 ++++ lib-src/ChangeLog | 8258 ----------- lib-src/ChangeLog.1 | 8258 +++++++++++ lisp/ChangeLog | 16532 ---------------------- lisp/ChangeLog.17 | 16532 ++++++++++++++++++++++ lisp/cedet/ChangeLog | 3088 ----- lisp/cedet/ChangeLog.1 | 3088 +++++ lisp/erc/ChangeLog | 721 - lisp/erc/ChangeLog.09 | 721 + lisp/gnus/ChangeLog | 25527 ---------------------------------- lisp/gnus/ChangeLog.3 | 25527 ++++++++++++++++++++++++++++++++++ lisp/mh-e/ChangeLog | 3692 ----- lisp/mh-e/ChangeLog.2 | 3692 +++++ lisp/org/ChangeLog | 32802 -------------------------------------------- lisp/org/ChangeLog.1 | 32802 ++++++++++++++++++++++++++++++++++++++++++++ lisp/url/ChangeLog | 2970 ---- lisp/url/ChangeLog.1 | 2970 ++++ lwlib/ChangeLog | 1878 --- lwlib/ChangeLog.1 | 1878 +++ msdos/ChangeLog | 1553 --- msdos/ChangeLog.1 | 1553 +++ nextstep/ChangeLog | 299 - nextstep/ChangeLog.1 | 299 + nt/ChangeLog | 3443 ----- nt/ChangeLog.1 | 3443 +++++ oldXMenu/ChangeLog | 684 - oldXMenu/ChangeLog.1 | 684 + src/ChangeLog | 11230 --------------- src/ChangeLog.13 | 11230 +++++++++++++++ test/ChangeLog | 1972 --- test/ChangeLog.1 | 1972 +++ 48 files changed, 176543 insertions(+), 176543 deletions(-) delete mode 100644 ChangeLog create mode 100644 ChangeLog.1 delete mode 100644 admin/ChangeLog create mode 100644 admin/ChangeLog.1 delete mode 100644 doc/emacs/ChangeLog create mode 100644 doc/emacs/ChangeLog.1 delete mode 100644 doc/lispintro/ChangeLog create mode 100644 doc/lispintro/ChangeLog.1 delete mode 100644 doc/lispref/ChangeLog create mode 100644 doc/lispref/ChangeLog.1 delete mode 100644 doc/man/ChangeLog create mode 100644 doc/man/ChangeLog.1 delete mode 100644 doc/misc/ChangeLog create mode 100644 doc/misc/ChangeLog.1 delete mode 100644 etc/ChangeLog create mode 100644 etc/ChangeLog.1 delete mode 100644 leim/ChangeLog create mode 100644 leim/ChangeLog.1 delete mode 100644 lib-src/ChangeLog create mode 100644 lib-src/ChangeLog.1 delete mode 100644 lisp/ChangeLog create mode 100644 lisp/ChangeLog.17 delete mode 100644 lisp/cedet/ChangeLog create mode 100644 lisp/cedet/ChangeLog.1 delete mode 100644 lisp/erc/ChangeLog create mode 100644 lisp/erc/ChangeLog.09 delete mode 100644 lisp/gnus/ChangeLog create mode 100644 lisp/gnus/ChangeLog.3 delete mode 100644 lisp/mh-e/ChangeLog create mode 100644 lisp/mh-e/ChangeLog.2 delete mode 100644 lisp/org/ChangeLog create mode 100644 lisp/org/ChangeLog.1 delete mode 100644 lisp/url/ChangeLog create mode 100644 lisp/url/ChangeLog.1 delete mode 100644 lwlib/ChangeLog create mode 100644 lwlib/ChangeLog.1 delete mode 100644 msdos/ChangeLog create mode 100644 msdos/ChangeLog.1 delete mode 100644 nextstep/ChangeLog create mode 100644 nextstep/ChangeLog.1 delete mode 100644 nt/ChangeLog create mode 100644 nt/ChangeLog.1 delete mode 100644 oldXMenu/ChangeLog create mode 100644 oldXMenu/ChangeLog.1 delete mode 100644 src/ChangeLog create mode 100644 src/ChangeLog.13 delete mode 100644 test/ChangeLog create mode 100644 test/ChangeLog.1 [The actual patch is about 12 MB and is elided here. The following shell commands implement the patch: find * -name ChangeLog | sed 's,.*,git mv & &.1, s, lisp/ChangeLog\.1$, lisp/ChangeLog.17, s, lisp/erc/ChangeLog\.1$, lisp/erc/ChangeLog.09, s, lisp/gnus/ChangeLog\.1$, lisp/gnus/ChangeLog.3, s, lisp/mh-e/ChangeLog\.1$, lisp/mh-e/ChangeLog.2, s, src/ChangeLog\.1$, src/ChangeLog.13,' | sh git commit -am'Rename old ChangeLog files to prepare for gitlog-to-changelog.' ] --------------080602050405000107040906 Content-Type: text/x-diff; name="0002-Generate-a-ChangeLog-file-from-commit-logs.patch" Content-Disposition: attachment; filename="0002-Generate-a-ChangeLog-file-from-commit-logs.patch" Content-Transfer-Encoding: quoted-printable >From 1afc98cadae8b14e1b123765463403df4947811a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 19 Nov 2014 14:41:42 -0800 Subject: [PATCH 2/2] Generate a ChangeLog file from commit logs. Instead of having a ChangeLog file or files in the repository, generate the ChangeLog file automatically from the git commit logs, as part of the process of making a distribution. The new procedure has been tested with vc-dwim, and this commit was generated by vc-dwim. Also, 'make dist woriks'. However, I haven't tested other ways to create change log entries nor hav= e I tested the entire release process, and no doubt further work is needed. * .gitignore: Add ChangeLog. * Makefile.in (gen_start_date): New macro. (gen-ChangeLog): New rule. * admin/admin.el (make-manuals-dist--1): Don't treat ChangeLog specially. * admin/merge-gnulib (GNULIB_MODULES): Add gitlog-to-changelog. * admin/notes/repo: Add note about vc-dwim. * admin/admin.el (add-release-logs, make-manuals-dist--1): * admin/make-tarball.txt, admin/notes/bugtracker: * lisp/emacs-lisp/authors.el: Add a FIXME comment. * build-aux/gitlog-to-changelog: New file, from Gnulib. * lisp/calendar/icalendar.el, lisp/gnus/deuglify.el: * lisp/emacs-lisp/gulp.el, lwlib/README, make-dist: Adjust to renamed old ChangeLog files. * make-dist: Use 'make gen-ChangeLog' to build top-level ChangeLog in the distribution. --- .gitignore | 1 + Makefile.in | 15 ++ admin/admin.el | 9 +- admin/make-tarball.txt | 4 + admin/merge-gnulib | 2 +- admin/notes/bugtracker | 3 +- admin/notes/repo | 13 +- build-aux/gitlog-to-changelog | 432 ++++++++++++++++++++++++++++++++++++= ++++++ lisp/calendar/icalendar.el | 4 +- lisp/emacs-lisp/authors.el | 5 +- lisp/emacs-lisp/gulp.el | 2 +- lisp/gnus/deuglify.el | 2 +- lwlib/README | 2 +- make-dist | 26 ++- 14 files changed, 497 insertions(+), 23 deletions(-) create mode 100755 build-aux/gitlog-to-changelog diff --git a/.gitignore b/.gitignore index a35ab93..53e3427 100644 --- a/.gitignore +++ b/.gitignore @@ -177,6 +177,7 @@ info/dir .#* =20 # Git output. +ChangeLog [0-9]*.patch =20 # Distribution directories. diff --git a/Makefile.in b/Makefile.in index 4391c2c..b122d80 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1100,6 +1100,21 @@ bootstrap: bootstrap-clean FRC $(MAKE) $(MFLAGS) MAKEFILE_NAME=3Dforce-Makefile force-Makefile $(MAKE) $(MFLAGS) info all =20 +# Convert git commit log to ChangeLog file. make-dist uses this. +gen_start_date =3D 2014-11-18 +.PHONY: gen-ChangeLog +gen-ChangeLog: + $(AM_V_GEN)if test -d .git; then \ + log_fix=3D"$(srcdir)/build-aux/git-log-fix"; \ + test -e "$$log_fix" \ + && amend_git_log=3D"--amend=3D$$log_fix" \ + || amend_git_log=3D; \ + $(srcdir)/build-aux/gitlog-to-changelog \ + $$amend_git_log --since=3D$(gen_start_date) > $(distdir)/cl-t && \ + { rm -f $(distdir)/ChangeLog && \ + mv $(distdir)/cl-t $(distdir)/ChangeLog; } \ + fi + .PHONY: check-declare =20 check-declare: diff --git a/admin/admin.el b/admin/admin.el index 48e083d..d3aa583 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -28,10 +28,9 @@ =20 (defvar add-log-time-format) ; in add-log =20 -;; Does this information need to be in every ChangeLog, as opposed to -;; just the top-level one? Only if you allow changes the same -;; day as the release. -;; http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00161.html +;; FIXME: Update this in the light of the fact that there's only +;; one ChangeLog file now, at the top level, and it's generated from +;; commit logs by 'make-dist'. (defun add-release-logs (root version &optional date) "Add \"Version VERSION released.\" change log entries in ROOT. Root must be the root of an Emacs source tree. @@ -650,7 +649,7 @@ style=3D\"text-align:left\">") (copy-file "../doc/misc/texinfo.tex" stem) (or (equal type "emacs") (copy-file "../doc/emacs/emacsver.texi" ste= m)) (dolist (file (directory-files (format "../doc/%s" type) t)) - (if (or (string-match-p "\\(\\.texi\\'\\|/ChangeLog\\|/README\\'\\= )" file) + (if (or (string-match-p "\\(\\.texi\\'\\|/README\\'\\)" file) (and (equal type "lispintro") (string-match-p "\\.\\(eps\\|pdf\\)\\'" file))) (copy-file file stem))) diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 9603c61..c080014 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -2,6 +2,10 @@ Instructions to create pretest or release tarballs. -*- = coding: utf-8 -*- -- originally written by Gerd Moellmann, amended by Francesco Potort=C3=AC with the initial help of Eli Zaretskii =20 +FIXME: There is now just one ChangeLog file, at the top level, +generated automatically from commit logs by 'make-dist'. The +procedure below needs to be updated accordingly. + =20 Steps to take before starting on the first pretest in any release sequen= ce: =20 diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 6c0dffb..dc33349 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -31,7 +31,7 @@ GNULIB_MODULES=3D' crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync - getloadavg getopt-gnu gettime gettimeofday + getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat diff --git a/admin/notes/bugtracker b/admin/notes/bugtracker index fd7bd08..9d03798 100644 --- a/admin/notes/bugtracker +++ b/admin/notes/bugtracker @@ -481,7 +481,8 @@ can see exactly what the fix was. *** bug-reference-mode =20 Activate `bug-reference-mode' in ChangeLogs to get clickable links to -the bug web-pages. +the bug web-pages. FIXME: This may need to be updated in the light of +the new policy of just one ChangeLog, at the top level. =20 *** Debian stuff =20 diff --git a/admin/notes/repo b/admin/notes/repo index 46a9e08..d077896 100644 --- a/admin/notes/repo +++ b/admin/notes/repo @@ -37,6 +37,16 @@ NEWS, MAINTAINERS, and FOR-RELEASE, or to indicate reg= eneration of files such as 'configure'. "There is no need" means you don't have to, but you can if you want to. =20 +** Using vc-dwim to maintain commit messages + +You can use vc-dwim to maintain commit messages in ChangeLog format. +When you create a source directory FOO, run the shell command 'cd FOO; +git-changelog-symlink-init' to create a symbolic link from ChangeLog +to .git/c/ChangeLog. Edit this ChangeLog via its symlink with Emacs +commands like add-change-log-entry-other-window, and commit the change +using the shell command 'cd FOO; vc-dwim'. Type 'vc-dwim --help' for +more info. + * Commit to the right branch =20 Development normally takes places on the trunk. @@ -132,7 +142,8 @@ http://lists.gnu.org/archive/html/emacs-devel/2010-05= /msg00262.html =20 * How to merge changes from emacs-24 to trunk =20 -[The section on git merge procedure has not yet been written] +[The section on git merge procedure has not yet been written. +Among other things, the ChangeLog file is now automatically generated.] =20 Inspect the change log entries (e.g. in case too many entries have been included or whitespace between entries needs fixing). If someone made diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelo= g new file mode 100755 index 0000000..78afff4 --- /dev/null +++ b/build-aux/gitlog-to-changelog @@ -0,0 +1,432 @@ +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 =3D '2012-07-29 06:11'; # 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-2014 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 . + +# Written by Jim Meyering + +use strict; +use warnings; +use Getopt::Long; +use POSIX qw(strftime); + +(my $ME =3D $0) =3D~ 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"; + $? ||=3D 1; +} + +sub usage ($) +{ + my ($exit_code) =3D @_; + my $STREAM =3D ($exit_code =3D=3D 0 ? *STDOUT : *STDERR); + if ($exit_code !=3D 0) + { + print $STREAM "Try '$ME --help' for more information.\n"; + } + else + { + print $STREAM < ChangeLog + $ME -- -n 5 foo > last-5-commits-to-branch-foo + +SPECIAL SYNTAX: + +The following types of strings are interpreted specially when they appea= r +at the beginning of a log message line. They are not copied to the outp= ut. + + Copyright-paperwork-exempt: Yes + Append the "(tiny change)" notation to the usual "date name email" + ChangeLog header to mark a change that does not require a copyright + assignment. + Co-authored-by: Joe User + List the specified name and email address on a second + ChangeLog header, denoting a co-author. + Signed-off-by: Joe User + These lines are simply elided. + +In a FILE specified via --amend, comment lines (starting with "#") are i= gnored. +FILE must consist of pairs where SHA is a 40-byte SHA1 (alon= e 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=3DFILE, 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 , + +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) =3D @_; + if ($s =3D~ m![^\w+/.,-]!) + { + # Convert each single quote to '\'' + $s =3D~ s/\'/\'\\\'\'/g; + # Then single quote the string. + $s =3D "'$s'"; + } + return $s; +} + +sub quoted_cmd(@) +{ + return join (' ', map {shell_quote $_} @_); +} + +# Parse file F. +# Comment lines (starting with "#") are ignored. +# F must consist of 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) =3D @_; + + open F, '<', $f + or die "$ME: $f: failed to open for reading: $!\n"; + + my $fail; + my $h =3D {}; + my $in_code =3D 0; + my $sha; + while (defined (my $line =3D )) + { + $line =3D~ /^\#/ + and next; + chomp $line; + $line eq '' + and $in_code =3D 0, next; + + if (!$in_code) + { + $line =3D~ /^([0-9a-fA-F]{40})$/ + or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"), + $fail =3D 1, next; + $sha =3D lc $1; + $in_code =3D 1; + exists $h->{$sha} + and (warn "$ME: $f:$.: duplicate SHA1\n"), + $fail =3D 1, next; + } + else + { + $h->{$sha} ||=3D ''; + $h->{$sha} .=3D "$line\n"; + } + } + close F; + + $fail + and exit 1; + + return $h; +} + +# git_dir_option $SRCDIR +# +# From $SRCDIR, the --git-dir option to pass to git (none if $SRCDIR +# is undef). Return as a list (0 or 1 element). +sub git_dir_option($) +{ + my ($srcdir) =3D @_; + my @res =3D (); + if (defined $srcdir) + { + my $qdir =3D shell_quote $srcdir; + my $cmd =3D "cd $qdir && git rev-parse --show-toplevel"; + my $qcmd =3D shell_quote $cmd; + my $git_dir =3D qx($cmd); + defined $git_dir + or die "$ME: cannot run $qcmd: $!\n"; + $? =3D=3D 0 + or die "$ME: $qcmd had unexpected exit code or signal ($?)\n"; + chomp $git_dir; + push @res, "--git-dir=3D$git_dir/.git"; + } + @res; +} + +{ + my $since_date; + my $format_string =3D '%s%n%b%n'; + my $amend_file; + my $append_dot =3D 0; + my $cluster =3D 1; + my $strip_tab =3D 0; + my $strip_cherry_pick =3D 0; + my $srcdir; + GetOptions + ( + help =3D> sub { usage 0 }, + version =3D> sub { print "$ME version $VERSION\n"; exit }, + 'since=3Ds' =3D> \$since_date, + 'format=3Ds' =3D> \$format_string, + 'amend=3Ds' =3D> \$amend_file, + 'append-dot' =3D> \$append_dot, + 'cluster!' =3D> \$cluster, + 'strip-tab' =3D> \$strip_tab, + 'strip-cherry-pick' =3D> \$strip_cherry_pick, + 'srcdir=3Ds' =3D> \$srcdir, + ) or usage 1; + + defined $since_date + and unshift @ARGV, "--since=3D$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 =3D defined $amend_file ? parse_amend_file $amend_file = : {}; + + my @cmd =3D ('git', + git_dir_option $srcdir, + qw(log --log-size), + '--pretty=3Dformat:%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_multi_paragraph; + my $prev_date_line =3D ''; + my @prev_coauthors =3D (); + while (1) + { + defined (my $in =3D ) + or last; + $in =3D~ /^log size (\d+)$/ + or die "$ME:$.: Invalid line (expected log size):\n$in"; + my $log_nbytes =3D $1; + + my $log; + my $n_read =3D read PIPE, $log, $log_nbytes; + $n_read =3D=3D $log_nbytes + or die "$ME:$.: unexpected EOF\n"; + + # Extract leading hash. + my ($sha, $rest) =3D split ':', $log, 2; + defined $sha + or die "$ME:$.: malformed log entry\n"; + $sha =3D~ /^[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 =3D $amend_code->{$sha}; + if (defined $code) + { + eval 'use Safe'; + my $s =3D new Safe; + # Put the unpreprocessed entry into "$_". + $_ =3D $rest; + + # Let $code operate on it, safely. + my $r =3D $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 =3D $_; + } + + # Remove lines inserted by "git cherry-pick". + if ($strip_cherry_pick) + { + $rest =3D~ s/^\s*Conflicts:\n.*//sm; + $rest =3D~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m; + } + + my @line =3D split "\n", $rest; + my $author_line =3D shift @line; + defined $author_line + or die "$ME:$.: unexpected EOF\n"; + $author_line =3D~ /^(\d+) (.*>)$/ + or die "$ME:$.: Invalid line " + . "(expected date/author/email):\n$author_line\n"; + + # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog + # `(tiny change)' annotation. + my $tiny =3D (grep (/^Copyright-paperwork-exempt:\s+[Yy]es$/, @lin= e) + ? ' (tiny change)' : ''); + + my $date_line =3D sprintf "%s %s$tiny\n", + strftime ("%F", localtime ($1)), $2; + + my @coauthors =3D grep /^Co-authored-by:.*$/, @line; + # Omit meta-data lines we've already interpreted. + @line =3D grep !/^(?:Signed-off-by:[ ].*>$ + |Co-authored-by:[ ] + |Copyright-paperwork-exempt:[ ] + )/x, @line; + + # Remove leading and trailing blank lines. + if (@line) + { + while ($line[0] =3D~ /^\s*$/) { shift @line; } + while ($line[$#line] =3D~ /^\s*$/) { pop @line; } + } + + # Record whether there are two or more paragraphs. + my $multi_paragraph =3D grep /^\s*$/, @line; + + # Format 'Co-authored-by: A U Thor ' lines in + # standard multi-author ChangeLog format. + for (@coauthors) + { + s/^Co-authored-by:\s*/\t /; + s/\s*/ + or warn "$ME: warning: missing email address for " + . substr ($_, 5) . "\n"; + } + + # If clustering of commit messages has been disabled, if this head= er + # would be different from the previous date/name/email/coauthors h= eader, + # or if this or the previous entry consists of two or more paragra= phs, + # then print the header. + if ( ! $cluster + || $date_line ne $prev_date_line + || "@coauthors" ne "@prev_coauthors" + || $multi_paragraph + || $prev_multi_paragraph) + { + $prev_date_line eq '' + or print "\n"; + print $date_line; + @coauthors + and print join ("\n", @coauthors), "\n"; + } + $prev_date_line =3D $date_line; + @prev_coauthors =3D @coauthors; + $prev_multi_paragraph =3D $multi_paragraph; + + # If there were any lines + if (@line =3D=3D 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 bla= nk + # at the end. + $line[0] =3D~ /[[:punct:]\s]$/ + or $line[0] .=3D '.'; + } + } + + # Remove one additional leading TAB from each line. + $strip_tab + and map { s/^\t// } @line; + + # Prefix each non-empty line with a TAB. + @line =3D map { length $_ ? "\t$_" : '' } @line; + + print "\n", join ("\n", @line), "\n"; + } + + defined ($in =3D ) + 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=3DF specified file. + my $fail =3D 0; + foreach my $sha (keys %$amend_code) + { + warn "$ME:$amend_file: unused entry: $sha\n"; + $fail =3D 1; + } + + exit $fail; +} + +# Local Variables: +# mode: perl +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "my $VERSION =3D '" +# time-stamp-format: "%:y-%02m-%02d %02H:%02M" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "'; # UTC" +# End: diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index 4ba4869..18aeb61 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -39,7 +39,7 @@ =20 ;;; History: =20 -;; 0.07 onwards: see lisp/ChangeLog +;; 0.07 onwards: see commit logs and ../ChangeLog*. =20 ;; 0.06: (2004-10-06) ;; - Bugfixes regarding icalendar-import-format-*. @@ -1047,7 +1047,7 @@ FExport diary data into iCalendar file: ") =20 (setq header (concat "\nBEGIN:VEVENT\nUID:" (or uid - (icalendar--create-uid entry-fu= ll=20 + (icalendar--create-uid entry-fu= ll contents= ))))) (setq result (concat result header contents "\nEND:VEVENT"= ))) ;; handle errors diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el index 51bd415..c53feee 100644 --- a/lisp/emacs-lisp/authors.el +++ b/lisp/emacs-lisp/authors.el @@ -27,6 +27,9 @@ ;; Use M-x authors RET to create an *Authors* buffer that can used as ;; or merged with Emacs's AUTHORS file. =20 +;; FIXME: This needs to modernized in the light of current practice, +;; which generates a single top-level ChangeLog file from commit logs. + ;;; Code: =20 (defvar authors-coding-system 'utf-8 @@ -75,7 +78,7 @@ files.") ("Gerd M=C3=B6llmann" "Gerd Moellmann") ("Hallvard B. Furuseth" "Hallvard B Furuseth" "Hallvard Furuseth") ("Hrvoje Nik=C5=A1i=C4=87" "Hrvoje Niksic") - ;; lisp/org/ChangeLog 2010-11-11. + ;; lisp/org/ChangeLog.1 2010-11-11. (nil "aaa bbb") (nil "Code Extracted") ; lisp/newcomment.el's "Author:" header ("Jaeyoun Chung" "Jae-youn Chung" "Jae-you Chung" "Chung Jae-youn") diff --git a/lisp/emacs-lisp/gulp.el b/lisp/emacs-lisp/gulp.el index d0a89b3..2d0314b 100644 --- a/lisp/emacs-lisp/gulp.el +++ b/lisp/emacs-lisp/gulp.el @@ -69,7 +69,7 @@ please send them to me ASAP. Please don't send the whole file. Instead, please send a patch made wit= h `diff -c' that shows precisely the changes you would like me to install. Also please include itemized change log entries for your changes; -please use lisp/ChangeLog as a guide for the style and for what kinds +please use lisp/ChangeLog* as a guide for the style and for what kinds of information to include. =20 Thanks.") diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el index 7a0f613..a28a255 100644 --- a/lisp/gnus/deuglify.el +++ b/lisp/gnus/deuglify.el @@ -188,7 +188,7 @@ ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; -;; See ChangeLog for other changes. +;; See commit log or ChangeLog* for other changes. ;; ;; Revision 1.5 2002/01/27 14:39:17 rscholz ;; * New variable `gnus-outlook-deuglify-no-wrap-chars' to inhibit diff --git a/lwlib/README b/lwlib/README index 25c72eb..ed7583d 100644 --- a/lwlib/README +++ b/lwlib/README @@ -4,4 +4,4 @@ library was written by Lucid, Inc and released under the = terms of the GPL version 1 (or later). It is not considered part of GNU Emacs. =20 This version of the library differs from the original as described in -the ChangeLog file. +the ChangeLog.1 file. diff --git a/make-dist b/make-dist index aed5b17..ab3b6e4 100755 --- a/make-dist +++ b/make-dist @@ -278,13 +278,20 @@ fi echo "Creating top directory: \`${tempdir}'" mkdir ${tempdir} =20 +if test -d .git; then + echo "Making top-level ChangeLog" + make distdir=3D${tempdir} gen-ChangeLog +else + echo "No repository, so omitting top-level ChangeLog" +fi + ### We copy in the top-level files before creating the subdirectories in ### hopes that this will make the top-level files appear first in the ### tar file; this means that people can start reading the INSTALL and ### README while the rest of the tar file is still unpacking. Whoopee. echo "Making links to top-level files" ln INSTALL README BUGS ${tempdir} -ln ChangeLog Makefile.in autogen.sh configure configure.ac ${tempdir} +ln ChangeLog.*[0-9] Makefile.in autogen.sh configure configure.ac ${temp= dir} ln config.bat make-dist .dir-locals.el ${tempdir} ln aclocal.m4 ${tempdir} =20 @@ -334,7 +341,7 @@ done echo "Making links to \`leim' and its subdirectories" (cd leim ln makefile.w32-in ../${tempdir}/leim - ln ChangeLog README ../${tempdir}/leim + ln ChangeLog.*[0-9] README ../${tempdir}/leim ln CXTERM-DIC/README CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC ln MISC-DIC/README MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC @@ -345,6 +352,7 @@ echo "Making links to \`leim' and its subdirectories" echo "Making links to \`build-aux'" (cd build-aux ln compile config.guess config.sub depcomp msys-to-w32 ../${tempdir}/bu= ild-aux + ln gitlog-to-changelog ../${tempdir}/build-aux ln install-sh missing move-if-change ../${tempdir}/build-aux ln update-copyright update-subdirs ../${tempdir}/build-aux ln dir_top make-info-dir ../${tempdir}/build-aux) @@ -361,7 +369,7 @@ echo "Making links to \`src'" ln [a-zA-Z]*.[chm] ../${tempdir}/src ln [a-zA-Z]*.in ../${tempdir}/src ln [a-zA-Z]*.mk ../${tempdir}/src - ln README ChangeLog ChangeLog.*[0-9] ../${tempdir}/src + ln README ChangeLog.*[0-9] ../${tempdir}/src ln makefile.w32-in ../${tempdir}/src ln .gdbinit .dbxinit ../${tempdir}/src cd ../${tempdir}/src @@ -383,7 +391,7 @@ echo "Making links to \`lib'" echo "Making links to \`lib-src'" (cd lib-src ln [a-zA-Z]*.[ch] ../${tempdir}/lib-src - ln ChangeLog Makefile.in README testfile ../${tempdir}/lib-src + ln ChangeLog.*[0-9] Makefile.in README testfile ../${tempdir}/lib-src ln grep-changelog rcs2log ../${tempdir}/lib-src ln makefile.w32-in ../${tempdir}/lib-src ln update-game-score.exe.manifest ../${tempdir}/lib-src) @@ -399,7 +407,7 @@ echo "Making links to \`nt'" ln nmake.defs gmake.defs subdirs.el [a-z]*.bat [a-z]*.[ch] ../${tempdir= }/nt ln Makefile.in gnulib.mk ../${tempdir}/nt ln mingw-cfg.site epaths.nt INSTALL.OLD ../${tempdir}/nt - ln ChangeLog INSTALL README README.W32 makefile.w32-in ../${tempdir}/nt= ) + ln ChangeLog.*[0-9] INSTALL README README.W32 makefile.w32-in ../${temp= dir}/nt) =20 echo "Making links to \`nt/inc' and its subdirectories" for f in `find nt/inc -type f -name '[a-z]*.h'`; do @@ -413,13 +421,13 @@ echo "Making links to \`nt/icons'" =20 echo "Making links to \`msdos'" (cd msdos - ln ChangeLog INSTALL README emacs.ico emacs.pif ../${tempdir}/msdos + ln ChangeLog.*[0-9] INSTALL README emacs.ico emacs.pif ../${tempdir}/ms= dos ln depfiles.bat inttypes.h ../${tempdir}/msdos ln is_exec.c sigaction.c mainmake.v2 sed*.inp ../${tempdir}/msdos) =20 echo "Making links to \`nextstep'" (cd nextstep - ln ChangeLog README INSTALL Makefile.in ../${tempdir}/nextstep) + ln ChangeLog.*[0-9] README INSTALL Makefile.in ../${tempdir}/nextstep) =20 echo "Making links to \`nextstep/templates'" (cd nextstep/templates @@ -440,12 +448,12 @@ echo "Making links to \`nextstep/GNUstep/Emacs.base= /Resources'" echo "Making links to \`oldXMenu'" (cd oldXMenu ln *.[ch] *.in ../${tempdir}/oldXMenu - ln README ChangeLog ../${tempdir}/oldXMenu) + ln README ChangeLog.*[0-9] ../${tempdir}/oldXMenu) =20 echo "Making links to \`lwlib'" (cd lwlib ln *.[ch] *.in ../${tempdir}/lwlib - ln README ChangeLog ../${tempdir}/lwlib) + ln README ChangeLog.*[0-9] ../${tempdir}/lwlib) =20 ## It is important to distribute admin/ because it contains sources ## for generated lisp/international/uni-*.el files. --=20 1.9.3 --------------080602050405000107040906--