git-svn: search --authors-prog in PATH too
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>
Andreas Heiduk committed
Mar 4, 2018 at 12:22 UTC
9c18398f8b75f34c2251224c9443b4e1271ff9ff
2 files changed
+7
-1
Documentation/git-svn.txt
+5
@@ -657,6 +657,11 @@ config key: svn.authorsfile
657
expected to return a single line of the form "Name <email>",
658
which will be treated as if included in the authors file.
659
+
660
+Due to historical reasons a relative 'filename' is first searched
661
+relative to the current directory for 'init' and 'clone' and relative
662
+to the root of the working tree for 'fetch'. If 'filename' is
663
+not found, it is searched like any other command in '$PATH'.
664
++
665
[verse]
666
config key: svn.authorsProg
667
git-svn.perl
+2
-1
@@ -374,7 +374,8 @@ version() if $_version;
374
usage(1) unless defined $cmd;
375
load_authors() if $_authors;
376
if (defined $_authors_prog) {
377
- $_authors_prog = "'" . File::Spec->rel2abs($_authors_prog) . "'";
377
+ my $abs_file = File::Spec->rel2abs($_authors_prog);
378
+ $_authors_prog = "'" . $abs_file . "'" if -x $abs_file;
379
}
380
381
unless ($cmd =~ /^(?:clone|init|multi-init|commit-diff)$/) {