git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Andreas Heiduk <asheiduk@gmail.com>
To: Git Mailing List <git@vger.kernel.org>, Eric Wong <e@80x24.org>
Cc: Andreas Heiduk <asheiduk@gmail.com>
Subject: [PATCH v2 1/2] git-svn: search --authors-prog in PATH too
Date: Sun, 11 Mar 2018 14:58:34 +0100	[thread overview]
Message-ID: <20180311135835.9775-2-asheiduk@gmail.com> (raw)
In-Reply-To: <20180311135835.9775-1-asheiduk@gmail.com>
In-Reply-To: <20180304112237.19254-1-asheiduk@gmail.co>

In 36db1eddf9 ("git-svn: add --authors-prog option", 2009-05-14) the path
to authors-prog was made absolute because git-svn changes the current
directory in some situations. This makes sense if the program is part of
the repository but prevents searching via $PATH.

The old behaviour is still retained, but if the file does not exists, then
authors-prog is searched for in $PATH as any other command.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Eric Wong <e@80x24.org>
---
 Documentation/git-svn.txt | 5 +++++
 git-svn.perl              | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 636e09048e..b858374649 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -657,6 +657,11 @@ config key: svn.authorsfile
 	expected to return a single line of the form "Name <email>",
 	which will be treated as if included in the authors file.
 +
+Due to historical reasons a relative 'filename' is first searched
+relative to the current directory for 'init' and 'clone' and relative
+to the root of the working tree for 'fetch'. If 'filename' is
+not found, it is searched like any other command in '$PATH'.
++
 [verse]
 config key: svn.authorsProg
 
diff --git a/git-svn.perl b/git-svn.perl
index a6b6c3e40c..050f2a36f4 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -374,7 +374,8 @@ version() if $_version;
 usage(1) unless defined $cmd;
 load_authors() if $_authors;
 if (defined $_authors_prog) {
-	$_authors_prog = "'" . File::Spec->rel2abs($_authors_prog) . "'";
+	my $abs_file = File::Spec->rel2abs($_authors_prog);
+	$_authors_prog = "'" . $abs_file . "'" if -x $abs_file;
 }
 
 unless ($cmd =~ /^(?:clone|init|multi-init|commit-diff)$/) {
-- 
2.16.2


  parent reply	other threads:[~2018-03-11 13:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180304112237.19254-1-asheiduk@gmail.co>
2018-03-11 13:58 ` [PATCH v2 0/2] git-svn: --author-prog improvements Andreas Heiduk
2018-03-18 21:19   ` Andreas Heiduk
2018-03-18 21:31     ` Eric Sunshine
2018-03-11 13:58 ` Andreas Heiduk [this message]
2018-03-11 13:58 ` [PATCH v2 2/2] git-svn: allow empty email-address in authors-prog and authors-file Andreas Heiduk
2018-03-18 23:04   ` Eric Wong
2018-03-19 22:48     ` Andreas Heiduk
2018-03-20 22:07       ` Eric Wong
2018-03-24 10:20         ` [PATCH v3] git-svn: allow empty email-address using " Andreas Heiduk
2018-04-05  7:51           ` Eric Wong
2018-04-05 18:23             ` Andreas Heiduk
2018-04-05 19:44               ` Eric Wong
2018-04-11 23:18                 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180311135835.9775-2-asheiduk@gmail.com \
    --to=asheiduk@gmail.com \
    --cc=e@80x24.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).