Skip to content

Commit 9c18398

Browse files
asheidukEric Wong
authored andcommitted
git-svn: search --authors-prog in PATH too
In 36db1ed ("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 <[email protected]> Signed-off-by: Eric Wong <[email protected]>
1 parent 468165c commit 9c18398

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Documentation/git-svn.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,11 @@ config key: svn.authorsfile
657657
expected to return a single line of the form "Name <email>",
658658
which will be treated as if included in the authors file.
659659
+
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+
+
660665
[verse]
661666
config key: svn.authorsProg
662667

git-svn.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ sub term_init {
374374
usage(1) unless defined $cmd;
375375
load_authors() if $_authors;
376376
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;
378379
}
379380

380381
unless ($cmd =~ /^(?:clone|init|multi-init|commit-diff)$/) {

0 commit comments

Comments
 (0)