>From 071a20671bc7b01565243529f51eb2236a0e7134 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 11 Jan 2015 22:42:09 -0800 Subject: [PATCH] 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. * .gitignore: Add ChangeLog. * CONTRIBUTE: Adjust suggested procedures accordingly. * Makefile.in (gen_origin): New macro. (gen-ChangeLog): New rule. * admin/admin.el (make-manuals-dist--1): Don't treat ChangeLog specially. * admin/make-tarball.txt, admin/notes/bugtracker, admin/notes/repo: * lisp/emacs-lisp/authors.el: Add a FIXME comment. * admin/merge-gnulib (GNULIB_MODULES): Add gitlog-to-changelog. * admin/admin.el (add-release-logs, make-manuals-dist--1): * build-aux/git-hooks/pre-commit: Disallow ChangeLog commits. * build-aux/gitlog-to-changelog: New file, from Gnulib. * build-aux/gitlog-to-emacslog: New file. * 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. Distribute gitlog-to-changelog. Fixes: bug#19113 --- .gitignore | 1 + CONTRIBUTE | 57 ++++-- Makefile.in | 8 + admin/admin.el | 9 +- admin/authors.el | 5 +- admin/make-tarball.txt | 4 + admin/merge-gnulib | 2 +- admin/notes/bugtracker | 3 +- admin/notes/repo | 3 +- build-aux/git-hooks/pre-commit | 18 +- build-aux/gitlog-to-changelog | 437 +++++++++++++++++++++++++++++++++++++++++ build-aux/gitlog-to-emacslog | 49 +++++ lisp/calendar/icalendar.el | 2 +- lisp/gnus/deuglify.el | 2 +- lisp/obsolete/gulp.el | 2 +- lwlib/README | 2 +- make-dist | 16 +- 17 files changed, 578 insertions(+), 42 deletions(-) create mode 100755 build-aux/gitlog-to-changelog create mode 100755 build-aux/gitlog-to-emacslog diff --git a/.gitignore b/.gitignore index 9810c1d..67d28653 100644 --- a/.gitignore +++ b/.gitignore @@ -237,6 +237,7 @@ info/dir *~ .#* \#*\# +ChangeLog [0-9]*.patch # Built by 'make install'. diff --git a/CONTRIBUTE b/CONTRIBUTE index 5cf015f..c5e36bd 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -27,10 +27,10 @@ advanced information. Alternately, see admin/notes/git-workflow. -If committing changes written by someone else, make the ChangeLog -entry in their name, not yours. git distinguishes between the author -and the committer; use the --author option on the commit command to -specify the actual author; the committer defaults to you. +If committing changes written by someone else, do so in their name, +not yours. git distinguishes between the author and the committer; +use the --author option on the commit command to specify the actual +author; the committer defaults to you. ** commit messages @@ -77,28 +77,29 @@ following modifications: and have a reasonable chance of being read in the future, so it's better that they have good presentation. -- There are multiple ChangeLogs in the emacs source; roughly one per - high-level directory. The ChangeLog entry for a commit belongs in the - lowest ChangeLog that is higher than or at the same level as any file - changed by the commit. - - Use the present tense; describe "what the change does", not "what the change did". -- Preferred form for several entries with the same content: - - * help.el (view-lossage): - * kmacro.el (kmacro-edit-lossage): - * edmacro.el (edit-kbd-macro): Fix docstring, lossage is now 300 keys. - - (Rather than anything involving "ditto" and suchlike.) - - If the commit fixes a bug, add a separate line Fixes: bug#NNNN where NNNN is the bug number. +- Here is an example, showing the preferred form for several entries + with the same content: + + Deactivate shifted region + + Do not silently extend a region that is not highlighted; + this can happen after a shift. + * lisp/window.el (handle-select-window): + * src/frame.c (Fhandle_switch_frame, Fselected_frame): + Deactivate the mark. + Fixes: bug#19003 + + (Rather than anything involving "ditto" and suchlike.) + - In ChangeLog entries, there is no standard or recommended way to identify revisions. @@ -113,6 +114,19 @@ following modifications: of files such as 'configure'. "There is no need" means you don't have to, but you can if you want to. +- If you use Emacs VC, one way to format ChangeLog entries is to create + a top-level ChangeLog file, and update it with 'C-x 4 a' file as + usual. Do not register the ChangeLog file under git; instead, use + 'C-c C-a' to insert its contents into into your *vc-log* buffer. + +- Alternatively, you can use the GNU command vc-dwim (if installed) + 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 'C-x 4 a', and commit the change using the shell + command 'cd FOO; vc-dwim'. + ** branches Development normally takes places on the trunk. @@ -176,6 +190,15 @@ to the tracker at http://debbugs.gnu.org . You can subscribe to the mailing lists, or see the list archives, by following links from http://savannah.gnu.org/mail/?group=emacs . +To send a git-format patch to the mailing list, which contains the +most recent commit in your private repository, you can use a shell +command like this: + + git format-patch -1 + git send-email 0001-*.patch + +Double-check the patch before sending it. + ** Document your changes. Any change that matters to end-users should have an entry in etc/NEWS. diff --git a/Makefile.in b/Makefile.in index 4cdd293..1c45f91 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1087,6 +1087,14 @@ bootstrap: bootstrap-clean $(MAKE) MAKEFILE_NAME=force-Makefile force-Makefile $(MAKE) all +# The first revision to appear in the generated ChangeLog. +gen_origin = 149749a1daea874283f83a882fb2e679d1417783 +# Convert git commit log to ChangeLog file. make-dist uses this. +.PHONY: gen-ChangeLog +gen-ChangeLog: + $(AM_V_GEN)distprefix=$(distprefix) srcprefix=$(srcdir)/ \ + $(srcdir)/build-aux/gitlog-to-emacslog $(gen_origin) + .PHONY: check-declare check-declare: diff --git a/admin/admin.el b/admin/admin.el index 18ea4a4..3988977 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -28,10 +28,9 @@ (defvar add-log-time-format) ; in add-log -;; 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. @@ -601,7 +600,7 @@ style=\"text-align:left\">") (copy-file "../doc/misc/texinfo.tex" stem) (or (equal type "emacs") (copy-file "../doc/emacs/emacsver.texi" stem)) (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/authors.el b/admin/authors.el index afab6f0..de6088d 100644 --- a/admin/authors.el +++ b/admin/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. +;; FIXME: This needs to modernized in the light of current practice, +;; which generates a single top-level ChangeLog file from commit logs. + ;;; Code: (defvar authors-coding-system 'utf-8 @@ -76,7 +79,7 @@ files.") ("Gerd Möllmann" "Gerd Moellmann") ("Hallvard B. Furuseth" "Hallvard B Furuseth" "Hallvard Furuseth") ("Hrvoje Nikšić" "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/admin/make-tarball.txt b/admin/make-tarball.txt index 8f8b031..81f573f 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ì with the initial help of Eli Zaretskii +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. + Steps to take before starting on the first pretest in any release sequence: diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 9e2b10d..e63422b 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -31,7 +31,7 @@ GNULIB_MODULES=' 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 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. *** Debian stuff diff --git a/admin/notes/repo b/admin/notes/repo index 2d4cc2a..f76187f 100644 --- a/admin/notes/repo +++ b/admin/notes/repo @@ -47,7 +47,8 @@ removes a file, then remove the corresponding files by hand. * How to merge changes from emacs-24 to trunk -[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.] 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/git-hooks/pre-commit b/build-aux/git-hooks/pre-commit index d050c40..8bce1f5 100755 --- a/build-aux/git-hooks/pre-commit +++ b/build-aux/git-hooks/pre-commit @@ -34,13 +34,15 @@ if test "$nbadchars" -ne 0; then exit 1 fi -new_names=`$git_diff HEAD` || exit -case " -$new_names" in - */-* | *' -'-*) - echo "File name component begins with '-'." - exit 1;; -esac +for new_name in `$git_diff HEAD`; do + case $new_name in + -* | */-*) + echo "$new_name: File name component begins with '-'." + exit 1;; + ChangeLog | */ChangeLog) + echo "$new_name: Please use git commit messages, not ChangeLog files." + exit 1;; + esac +done exec git diff-index --check --cached HEAD -- diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog new file mode 100755 index 0000000..190f7b5 --- /dev/null +++ b/build-aux/gitlog-to-changelog @@ -0,0 +1,437 @@ +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 = '2014-11-20 17:25'; # 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 = $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 < ChangeLog + $ME -- -n 5 foo > last-5-commits-to-branch-foo + +SPECIAL SYNTAX: + +The following types of strings are interpreted specially when they appear +at the beginning of a log message line. They are not copied to the output. + + 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 ignored. +FILE 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. + +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 , + +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 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 = )) + { + $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; +} + +# 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) = @_; + my @res = (); + if (defined $srcdir) + { + my $qdir = shell_quote $srcdir; + my $cmd = "cd $qdir && git rev-parse --show-toplevel"; + my $qcmd = shell_quote $cmd; + my $git_dir = qx($cmd); + defined $git_dir + or die "$ME: cannot run $qcmd: $!\n"; + $? == 0 + or die "$ME: $qcmd had unexpected exit code or signal ($?)\n"; + chomp $git_dir; + push @res, "--git-dir=$git_dir/.git"; + } + @res; +} + +{ + my $since_date; + my $until_date; + my $format_string = '%s%n%b%n'; + my $amend_file; + my $append_dot = 0; + my $cluster = 1; + my $strip_tab = 0; + my $strip_cherry_pick = 0; + my $srcdir; + GetOptions + ( + help => sub { usage 0 }, + version => sub { print "$ME version $VERSION\n"; exit }, + 'since=s' => \$since_date, + 'until=s' => \$until_date, + 'format=s' => \$format_string, + 'amend=s' => \$amend_file, + 'append-dot' => \$append_dot, + 'cluster!' => \$cluster, + 'strip-tab' => \$strip_tab, + 'strip-cherry-pick' => \$strip_cherry_pick, + 'srcdir=s' => \$srcdir, + ) or usage 1; + + defined $since_date + and unshift @ARGV, "--since=$since_date"; + defined $until_date + and unshift @ARGV, "--until=$until_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 = ('git', + git_dir_option $srcdir, + qw(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_multi_paragraph; + my $prev_date_line = ''; + my @prev_coauthors = (); + while (1) + { + defined (my $in = ) + 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 = $_; + } + + # Remove lines inserted by "git cherry-pick". + if ($strip_cherry_pick) + { + $rest =~ s/^\s*Conflicts:\n.*//sm; + $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m; + } + + 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"; + + # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog + # `(tiny change)' annotation. + my $tiny = (grep (/^Copyright-paperwork-exempt:\s+[Yy]es$/, @line) + ? ' (tiny change)' : ''); + + my $date_line = sprintf "%s %s$tiny\n", + strftime ("%F", localtime ($1)), $2; + + my @coauthors = grep /^Co-authored-by:.*$/, @line; + # Omit meta-data lines we've already interpreted. + @line = grep !/^(?:Signed-off-by:[ ].*>$ + |Co-authored-by:[ ] + |Copyright-paperwork-exempt:[ ] + )/x, @line; + + # Remove leading and trailing blank lines. + if (@line) + { + while ($line[0] =~ /^\s*$/) { shift @line; } + while ($line[$#line] =~ /^\s*$/) { pop @line; } + } + + # Record whether there are two or more paragraphs. + my $multi_paragraph = 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 header + # would be different from the previous date/name/email/coauthors header, + # or if this or the previous entry consists of two or more paragraphs, + # 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 = $date_line; + @prev_coauthors = @coauthors; + $prev_multi_paragraph = $multi_paragraph; + + # 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] .= '.'; + } + } + + # Remove one additional leading TAB from each line. + $strip_tab + and map { s/^\t// } @line; + + # Prefix each non-empty line with a TAB. + @line = map { length $_ ? "\t$_" : '' } @line; + + print "\n", join ("\n", @line), "\n"; + } + + defined ($in = ) + 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/build-aux/gitlog-to-emacslog b/build-aux/gitlog-to-emacslog new file mode 100755 index 0000000..8ea8112 --- /dev/null +++ b/build-aux/gitlog-to-emacslog @@ -0,0 +1,49 @@ +#!/bin/sh + +# Convert git log output to ChangeLog format for GNU Emacs. + +# Copyright (C) 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 . + +LC_ALL=C +export LC_ALL + +gen_origin=${1?} +shift + +if test -d ${srcprefix}.git; then + gen_origin_date=`git log --pretty=format:%ci "$gen_origin"^! ` || exit + gen_start_year=`expr "$gen_origin_date" : '\([^-]*\)'` || exit + log_fix="${srcprefix}build-aux/git-log-fix" + test -e "$log_fix" && set -- "$@" --amend="$log_fix" + + ${srcprefix}build-aux/gitlog-to-changelog "$@" $gen_origin^.. \ + > ${distprefix}cl-t || exit + + gen_end_year=`sed 's/-.*//; q' ${distprefix}cl-t` + if test "$gen_start_year" = "$gen_end_year"; then + year_range=$gen_start_year + else + year_range=$gen_start_year-$gen_end_year + fi + + sed "1d + s/Copyright (C) [0-9]*-[0-9]*/Copyright (C) $year_range/ + s/^# // + /http:/q + " Makefile.in >>${distprefix}cl-t && + rm -f ${distprefix}ChangeLog && + mv ${distprefix}cl-t ${distprefix}ChangeLog +fi diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index 452a672..da5d85e 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -39,7 +39,7 @@ ;;; History: -;; 0.07 onwards: see lisp/ChangeLog +;; 0.07 onwards: see commit logs and ../ChangeLog*. ;; 0.06: (2004-10-06) ;; - Bugfixes regarding icalendar-import-format-*. diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el index 00d1ee9..92f2c00 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/lisp/obsolete/gulp.el b/lisp/obsolete/gulp.el index 5ff99f2..f0223fa 100644 --- a/lisp/obsolete/gulp.el +++ b/lisp/obsolete/gulp.el @@ -70,7 +70,7 @@ please send them to me ASAP. Please don't send the whole file. Instead, please send a patch made with `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. Thanks.") 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. 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 4e05594..f66a0db 100755 --- a/make-dist +++ b/make-dist @@ -277,13 +277,20 @@ fi echo "Creating top directory: \`${tempdir}'" mkdir ${tempdir} +if test -d .git; then + echo "Making top-level ChangeLog" + make distprefix=${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 ${tempdir} ln config.bat make-dist .dir-locals.el ${tempdir} ln aclocal.m4 ${tempdir} @@ -333,7 +340,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 @@ -344,6 +351,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}/build-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) @@ -360,7 +368,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 @@ -398,7 +406,7 @@ echo "Making links to \`nt'" ln nmake.defs gmake.defs subdirs.el [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt ln *.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 ../${tempdir}/nt) echo "Making links to \`nt/inc' and its subdirectories" for f in `find nt/inc -type f -name '[a-z]*.h'`; do -- 2.1.0