DORMANTno replies

[PATCH] Enable tilde expansion for svn.authorsprog parameter

From: Robert Quattlebaum <hidden>
Date: 2016-06-15 22:51:10
Subsystem: the rest · Maintainer: Linus Torvalds

While tilde (~) expansion often happens automatically at the command
line, it does not occur automatically for paths specified in the
git configuration file. This is unfortunate because it is often
useful to specify path names relative to the current user's (or
some other user's) home directory.  This patch adds support for
tilde expansion for the svn.authorsprog configuraiton option using
perl's glob() function.

As a side effect of this change, if you pass an 'authors-prog' via
the command line that it will be subjected to tilde expansion
*twice*. This is only a problem for usernames that have real tildes
or wildcards in them, which should be extraordinarily rare.

Also, since tilde expansion is performed using glob(), there is a
chance that if the authors-prog contains a wild card that it will
match multiple executables. In such a case the behavior will almost
certainly be undesirable.

I'm submitting this patch more for discussion than for consideration
at this point. I feel that there might be a better way to go about
this, but I'm not familiar enough with the codebase to know what
that might be.

Signed-off-by: Robert Quattlebaum <redacted>
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 0fd2fd2..ff2591e 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -307,7 +307,7 @@ version() if $_version;
 usage(1) unless defined $cmd;
 load_authors() if $_authors;
 if (defined $_authors_prog) {
-	$_authors_prog = "'" . File::Spec->rel2abs($_authors_prog) . "'";
+	$_authors_prog = "'" . File::Spec->rel2abs(glob($_authors_prog)) . "'";
 }
 
 unless ($cmd =~ /^(?:clone|init|multi-init|commit-diff)$/) {
-- 
1.7.4.1


__________________
Robert Quattlebaum
Jabber: darco@deepdarc.com
eMail:  darco@deepdarc.com
www:    http://www.deepdarc.com/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help