git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/2] git-svn: search --authors-prog in PATH too
@ 2018-03-04 11:22 Andreas Heiduk
  2018-03-04 11:22 ` [PATCH 2/2] git-svn: allow empty email-address in authors-prog and authors-file Andreas Heiduk
  2018-03-05  0:52 ` [PATCH 1/2] git-svn: search --authors-prog in PATH too Eric Sunshine
  0 siblings, 2 replies; 11+ messages in thread
From: Andreas Heiduk @ 2018-03-04 11:22 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Eric Wong, Andreas Heiduk

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
directoy 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 search in $PATH as any other command.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-03-06 22:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-04 11:22 [PATCH 1/2] git-svn: search --authors-prog in PATH too Andreas Heiduk
2018-03-04 11:22 ` [PATCH 2/2] git-svn: allow empty email-address in authors-prog and authors-file Andreas Heiduk
2018-03-05  1:42   ` Eric Sunshine
2018-03-05  9:37     ` Andreas Heiduk
2018-03-05 20:20       ` Eric Wong
2018-03-05 22:22       ` Eric Sunshine
2018-03-06 22:24       ` Andreas Heiduk
2018-03-05  0:52 ` [PATCH 1/2] git-svn: search --authors-prog in PATH too Eric Sunshine
2018-03-05 17:52   ` Eric Wong
2018-03-05 19:48     ` Andreas Heiduk
2018-03-05 20:16       ` Andreas Heiduk

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).