git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/2] git-svn: search --authors-prog in PATH too

From
Andreas Heiduk <asheiduk@gmail.com>
Date
Mar 11, 2018, 13:58 UTC
Message-ID
<20180311135835.9775-2-asheiduk@gmail.com>
In-Reply-To
<20180311135835.9775-1-asheiduk@gmail.com>

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
Previous: Andreas HeidukNext: Andreas Heiduk
Message 2 of 13 in “git-svn: --author-prog improvements”
  1. 0/2 git-svn: --author-prog improvementsAndreas Heiduk, Mar 11, 2018
  2. 1/2 git-svn: search --authors-prog in PATH tooAndreas Heiduk, Mar 11, 2018
  3. 2/2 git-svn: allow empty email-address in authors-prog and authors-fileAndreas Heiduk, Mar 11, 2018
  4. Eric WongMar 18, 2018
  5. Andreas HeidukMar 19, 2018
  6. Eric WongMar 20, 2018
  7. git-svn: allow empty email-address using authors-prog and authors-fileAndreas Heiduk, Mar 24, 2018
  8. Eric WongApr 5, 2018
  9. Andreas HeidukApr 5, 2018
  10. Eric WongApr 5, 2018
  11. Junio C HamanoApr 11, 2018
  12. Andreas HeidukMar 18, 2018
  13. Eric SunshineMar 18, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.