#!/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