Avoid changing directory when generating the ChangeLog file.
Instead, pass the repo path to either hg or log2cl.pl
This commit is contained in:
14
Makefile.in
14
Makefile.in
@@ -23,7 +23,7 @@ abs_top_srcdir = @abs_top_srcdir@
|
|||||||
top_builddir = @top_builddir@
|
top_builddir = @top_builddir@
|
||||||
abs_top_builddir = @abs_top_builddir@
|
abs_top_builddir = @abs_top_builddir@
|
||||||
devdir = @devdir@
|
devdir = @devdir@
|
||||||
scriptdir = $(abs_top_srcdir)/scripts
|
scriptdir = $(top_srcdir)/scripts
|
||||||
|
|
||||||
# Installation paths for package building
|
# Installation paths for package building
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
@@ -222,16 +222,16 @@ depend: siglist.c signame.c
|
|||||||
--file $(top_builddir)/src/Makefile
|
--file $(top_builddir)/src/Makefile
|
||||||
|
|
||||||
ChangeLog:
|
ChangeLog:
|
||||||
if test -d $(srcdir)/.hg && cd $(srcdir); then \
|
if test -d $(srcdir)/.hg; then \
|
||||||
if hg log --style=changelog -r "sort(branch(.) or follow(), -date)" > $@.tmp; then \
|
if hg log -R $(srcdir) --style=changelog -r "sort(branch(.) or follow(), -date)" > $@.tmp; then \
|
||||||
mv -f $@.tmp $@; \
|
mv -f $@.tmp $(srcdir)/$@; \
|
||||||
else \
|
else \
|
||||||
rm -f $@.tmp; \
|
rm -f $@.tmp; \
|
||||||
fi; \
|
fi; \
|
||||||
elif test -d $(srcdir)/.git && cd $(srcdir); then \
|
elif test -d $(srcdir)/.git; then \
|
||||||
$(scriptdir)/log2cl.pl -b master > $@; \
|
$(scriptdir)/log2cl.pl -R $(srcdir)/.git > $(srcdir)/$@; \
|
||||||
else \
|
else \
|
||||||
echo "ChangeLog data not available" > $@; \
|
echo "ChangeLog data not available" > $(srcdir)/$@; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
config.status:
|
config.status:
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: ISC
|
# SPDX-License-Identifier: ISC
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017 Todd C. Miller <Todd.Miller@sudo.ws>
|
# Copyright (c) 2017, 2020 Todd C. Miller <Todd.Miller@sudo.ws>
|
||||||
#
|
#
|
||||||
# Permission to use, copy, modify, and distribute this software for any
|
# Permission to use, copy, modify, and distribute this software for any
|
||||||
# purpose with or without fee is hereby granted, provided that the above
|
# purpose with or without fee is hereby granted, provided that the above
|
||||||
@@ -19,10 +19,23 @@
|
|||||||
# Simple script to massage "git log" output into a GNU style ChangeLog.
|
# Simple script to massage "git log" output into a GNU style ChangeLog.
|
||||||
# The goal is to emulate "hg log --style=changelog" via perl format.
|
# The goal is to emulate "hg log --style=changelog" via perl format.
|
||||||
|
|
||||||
|
use Getopt::Std;
|
||||||
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
# Git log format: author date, author name, author email
|
||||||
|
# abbreviated commit hash
|
||||||
|
# raw commit body
|
||||||
my $format="%ad %aN <%aE>%n%h%n%B%n";
|
my $format="%ad %aN <%aE>%n%h%n%B%n";
|
||||||
my @cmd = ("git", "log", "--log-size", "--name-only", "--date=short", "--format=$format", @ARGV);
|
|
||||||
|
# Parse options and build up "git log" command
|
||||||
|
my @cmd = ( "git" );
|
||||||
|
my %opts;
|
||||||
|
getopts('b:R:', \%opts);
|
||||||
|
push(@cmd, "-b", $opts{"b"}) if exists $opts{"b"};
|
||||||
|
push(@cmd, "--git-dir", $opts{"R"}) if exists $opts{"R"};
|
||||||
|
push(@cmd, "log", "--log-size", "--name-only", "--date=short", "--format=$format", @ARGV);
|
||||||
|
|
||||||
open(LOG, '-|', @cmd) || die "$0: unable to run git log: $!";
|
open(LOG, '-|', @cmd) || die "$0: unable to run git log: $!";
|
||||||
|
|
||||||
my $hash;
|
my $hash;
|
||||||
|
Reference in New Issue
Block a user