Skip to content

Commit 6b48829

Browse files
author
Eric Wong
committed
git svn: revert default behavior for --minimize-url
This reverts the --minimize-url behavior change that appeared recently in commit 0b2af45 ("Fix branch detection when repository root is inaccessible"). However, we now allow the option to be turned off by allowing "--no-minimize-url" so people with limited-access setups can still take advantage of the fix in 0b2af45. Also document the behavior and default settings of minimize-url in the manpage for the first time. This introduces a temporary UI regression to allow t9141 to pass that will be reverted (fixed) in the next commit. Signed-off-by: Eric Wong <[email protected]>
1 parent 2da9ee0 commit 6b48829

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

Documentation/git-svn.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ COMMANDS
8080
When passed to 'init' or 'clone' this regular expression will
8181
be preserved as a config key. See 'fetch' for a description
8282
of '--ignore-paths'.
83+
--no-minimize-url;;
84+
When tracking multiple directories (using --stdlayout,
85+
--branches, or --tags options), git svn will attempt to connect
86+
to the root (or highest allowed level) of the Subversion
87+
repository. This default allows better tracking of history if
88+
entire projects are moved within a repository, but may cause
89+
issues on repositories where read access restrictions are in
90+
place. Passing '--no-minimize-url' will allow git svn to
91+
accept URLs as-is without attempting to connect to a higher
92+
level directory. This option is off by default when only
93+
one URL/branch is tracked (it would do little good).
8394

8495
'fetch'::
8596
Fetch unfetched revisions from the Subversion remote we are

git-svn.perl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
$Git::SVN::default_repo_id = 'svn';
2020
$Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';
2121
$Git::SVN::Ra::_log_window_size = 100;
22+
$Git::SVN::_minimize_url = 'unset';
2223

2324
$Git::SVN::Log::TZ = $ENV{TZ};
2425
$ENV{TZ} = 'UTC';
@@ -100,7 +101,7 @@ BEGIN
100101
'trunk|T=s' => \$_trunk, 'tags|t=s@' => \@_tags,
101102
'branches|b=s@' => \@_branches, 'prefix=s' => \$_prefix,
102103
'stdlayout|s' => \$_stdlayout,
103-
'minimize-url|m' => \$Git::SVN::_minimize_url,
104+
'minimize-url|m!' => \$Git::SVN::_minimize_url,
104105
'no-metadata' => sub { $icv{noMetadata} = 1 },
105106
'use-svm-props' => sub { $icv{useSvmProps} = 1 },
106107
'use-svnsync-props' => sub { $icv{useSvnsyncProps} = 1 },
@@ -399,6 +400,10 @@ sub cmd_init {
399400
init_subdir(@_);
400401
do_git_init_db();
401402

403+
if ($Git::SVN::_minimize_url eq 'unset') {
404+
$Git::SVN::_minimize_url = 0;
405+
}
406+
402407
Git::SVN->init($url);
403408
}
404409

t/t9141-git-svn-multiple-branches.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,22 @@ test_expect_success 'Multiple branch or tag paths require -d' '
9999

100100
test_expect_success 'create new branches and tags' '
101101
( cd git_project &&
102-
git svn branch -m "New branch 1" -d b_one New1 ) &&
102+
git svn branch -m "New branch 1" -d project/b_one New1 ) &&
103103
( cd svn_project &&
104104
svn_cmd up && test -e b_one/New1/a.file ) &&
105105
106106
( cd git_project &&
107-
git svn branch -m "New branch 2" -d b_two New2 ) &&
107+
git svn branch -m "New branch 2" -d project/b_two New2 ) &&
108108
( cd svn_project &&
109109
svn_cmd up && test -e b_two/New2/a.file ) &&
110110
111111
( cd git_project &&
112-
git svn branch -t -m "New tag 1" -d tags_A Tag1 ) &&
112+
git svn branch -t -m "New tag 1" -d project/tags_A Tag1 ) &&
113113
( cd svn_project &&
114114
svn_cmd up && test -e tags_A/Tag1/a.file ) &&
115115
116116
( cd git_project &&
117-
git svn tag -m "New tag 2" -d tags_B Tag2 ) &&
117+
git svn tag -m "New tag 2" -d project/tags_B Tag2 ) &&
118118
( cd svn_project &&
119119
svn_cmd up && test -e tags_B/Tag2/a.file )
120120
'

0 commit comments

Comments
 (0)