From cec9264f17f5cb4a1bc0f41d51c7f62c6bf4784e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 19 Jul 2016 10:02:39 +0000 Subject: [PATCH 1/2] git-svn: document svn.authorsProg in config This has always been supported since we read config variables based on the command-line option parser. Document it explicitly since users usually want to maintain the same program across invocations. Signed-off-by: Eric Wong --- Documentation/git-svn.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt index 7e17cade7f..5f9e65b0c4 100644 --- a/Documentation/git-svn.txt +++ b/Documentation/git-svn.txt @@ -625,6 +625,9 @@ config key: svn.authorsfile with the committer name as the first argument. The program is expected to return a single line of the form "Name ", which will be treated as if included in the authors file. ++ +[verse] +config key: svn.authorsProg -q:: --quiet:: From c0071ae5dc1c610ab3791ece7ccf7d4772fde151 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 22 Jul 2016 20:17:31 +0000 Subject: [PATCH 2/2] git-svn: allow --version to work anywhere Checking the version of the installed SVN libraries should not require a git repository at all. This matches the behavior of "git --version". Add a test for "git svn help" for the same behavior while we're at it, too. Signed-off-by: Eric Wong --- git-svn.perl | 4 ++-- t/t9100-git-svn-basic.sh | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/git-svn.perl b/git-svn.perl index f609e54ce3..4d41d220a0 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -339,7 +339,7 @@ if ($cmd && $cmd =~ /(?:clone|init|multi-init)$/) { die "failed to open $ENV{GIT_DIR}: $!\n"; $ENV{GIT_DIR} = $1 if <$fh> =~ /^gitdir: (.+)$/; } -} else { +} elsif ($cmd) { my ($git_dir, $cdup); git_cmd_try { $git_dir = command_oneline([qw/rev-parse --git-dir/]); @@ -356,7 +356,7 @@ if ($cmd && $cmd =~ /(?:clone|init|multi-init)$/) { my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd); -read_git_config(\%opts); +read_git_config(\%opts) if $ENV{GIT_DIR}; if ($cmd && ($cmd eq 'log' || $cmd eq 'blame')) { Getopt::Long::Configure('pass_through'); } diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh index 28082b134f..ab6593b910 100755 --- a/t/t9100-git-svn-basic.sh +++ b/t/t9100-git-svn-basic.sh @@ -19,6 +19,25 @@ case "$GIT_SVN_LC_ALL" in ;; esac +deepdir=nothing-above +ceiling=$PWD + +test_expect_success 'git svn --version works anywhere' ' + mkdir -p "$deepdir" && ( + export GIT_CEILING_DIRECTORIES="$ceiling" && + cd "$deepdir" && + git svn --version + ) +' + +test_expect_success 'git svn help works anywhere' ' + mkdir -p "$deepdir" && ( + export GIT_CEILING_DIRECTORIES="$ceiling" && + cd "$deepdir" && + git svn help + ) +' + test_expect_success \ 'initialize git svn' ' mkdir import &&