export LC_ALL
# The newest revision that should not appear in the generated ChangeLog.
-gen_origin=2c1b8604946efbcd8ec5dd6c6dda7541ce4fc3c0
+gen_origin=325bf192ae281046834884b12705d6c522871b24
force=
output=ChangeLog
nmax=2
shift
done
+if [ ! -f ChangeLog.$nmax ]; then
+ echo "Can't find ChangeLog.$nmax" >&2
+ echo "Must be run from the top source directory" >&2
+ exit 1
+fi
+
if [ -f "$output" ]; then
- [ ! "$force" ] && echo "$output exists" && exit 1
+ [ ! "$force" ] && echo "$output exists" >&2 && exit 1
rm -f "$output" || exit 1
fi
# If this is not a Git repository, just generate an empty ChangeLog.
-test -d ${srcprefix}.git || {
+test -d .git || {
>"$output"
exit
}
# Use Gnulib's packaged ChangeLog generator.
-${srcprefix}build-aux/gitlog-to-changelog --ignore-matching='^; ' \
- --format='%B' \
+./build-aux/gitlog-to-changelog --ignore-matching='^; ' \
+ --ignore-line='^; ' --format='%B' \
"$gen_origin.." >"ChangeLog.tmp" || exit
if test -s "ChangeLog.tmp"; then