]>
code.delx.au - gnu-emacs/blob - build-aux/gitlog-to-emacslog
3 # Convert git log output to ChangeLog format for GNU Emacs.
5 # Copyright (C) 2014-2015 Free Software Foundation, Inc.
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 test -n "$output" || output
=ChangeLog
29 # If this is not a Git repository, just generate an empty ChangeLog.
30 test -d ${srcprefix}.git ||
{
31 # Remove any old ChangeLog, in case it is a vc-dwim symlink.
32 rm -f "${distprefix}$output" ||
exit
33 >"${distprefix}$output"
37 # Use Gnulib's packaged ChangeLog generator.
38 ${srcprefix}build-aux
/gitlog-to-changelog
--ignore-matching='^; ' \
40 "$gen_origin.." >"${distprefix}ChangeLog.tmp" ||
exit
42 if test -s "${distprefix}ChangeLog.tmp"; then
44 # Fix up bug references.
45 # This would be better as eg a --transform option to gitlog-to-changelog,
46 # but... effort. FIXME does not handle rare cases like:
47 # Fixes: debbugs:19434 debbugs:19519
48 sed 's/ Fixes: \(debbugs:\|bug#\)\([0-9][0-9]*\)/ (Bug#\2)/' \
49 "${distprefix}ChangeLog.tmp" > "${distprefix}ChangeLog.tmp2"
50 mv "${distprefix}ChangeLog.tmp2" "${distprefix}ChangeLog.tmp"
52 # Find the years covered by the generated ChangeLog, so that
53 # a proper copyright notice can be output.
55 sed -n 's/^\([0-9][0-9]*\).*/\1/p' "${distprefix}ChangeLog.tmp" |
60 for year
in $years; do
61 : ${start_year:=$year}
65 if test "$start_year" = "$end_year"; then
66 year_range
=$start_year
68 year_range
=$start_year-$end_year
71 # Append a proper copyright notice.
75 /^;; Local Variables:/,${
76 s/\(Copyright[ (C)]*\)[0-9]*-[0-9]*/\1'"$year_range"'/
79 ' <ChangeLog
.2 >>"${distprefix}ChangeLog.tmp" ||
exit
82 # Install the generated ChangeLog.
83 test "$output" = "ChangeLog.tmp" || \
84 mv -i "${distprefix}ChangeLog.tmp" "${distprefix}$output"