[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gitlog-to-changelog: VPATH build issues.
From: |
Akim Demaille |
Subject: |
Re: [PATCH] gitlog-to-changelog: VPATH build issues. |
Date: |
Mon, 16 Jul 2012 20:47:31 +0200 |
Le 16 juil. 2012 à 15:50, Eric Blake a écrit :
> I prefer --srcdir, if only because we already switched from CVS to git,
> and might in the future switch from git to $shiny_new_vcs. Tying the
> VCS name to the option means one more place to swap in that theoretical
> future.
OK. Installed as follows.
From 368a317788935c0423dc2afbd16754d9c7c73a48 Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Sun, 15 Jul 2012 16:22:31 +0200
Subject: [PATCH] gitlog-to-changelog: VPATH build issues.
If builddir is not a subdirectory of srcdir, running git from it will
fail.
* build-aux/gitlog-to-changelog (--srcdir): New option.
---
ChangeLog | 7 +++++++
build-aux/gitlog-to-changelog | 10 +++++++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 21db377..b073b2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-07-15 Akim Demaille <address@hidden>
+
+ gitlog-to-changelog: VPATH build issues
+ If builddir is not a subdirectory of srcdir, running git from it will
+ fail.
+ * build-aux/gitlog-to-changelog (--srcdir): New option.
+
2012-07-15 Bruno Haible <address@hidden>
fpending: Assume AC_CHECK_DECLS_ONCE invocation, like in fpending.m4.
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 17c4562..d79e7aa 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
if 0;
# Convert git log output to ChangeLog format.
-my $VERSION = '2012-05-22 09:40'; # UTC
+my $VERSION = '2012-07-16 18:34'; # 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
@@ -68,6 +68,7 @@ OPTIONS:
header; the default is to cluster adjacent commit messages
if their headers are the same and neither commit message
contains multiple paragraphs.
+ --srcdir=DIR the root of the source tree, containing the '.git' directory.
--since=DATE convert only the logs since DATE;
the default is to convert all log entries.
--format=FMT set format string for commit subject and body;
@@ -200,6 +201,7 @@ sub parse_amend_file($)
my $cluster = 1;
my $strip_tab = 0;
my $strip_cherry_pick = 0;
+ my $srcdir;
GetOptions
(
help => sub { usage 0 },
@@ -211,9 +213,9 @@ sub parse_amend_file($)
'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";
@@ -221,7 +223,9 @@ sub parse_amend_file($)
# 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 = (qw (git log --log-size),
+ my @cmd = ('git',
+ defined $srcdir ? ("--git-dir=$srcdir/.git") : (),
+ 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"
--
1.7.11.2