@matheusbsbs / matheus-bagliano / commits / 6b48829dbb
Fork 0

git svn: revert default behavior for --minimize-url

This reverts the --minimize-url behavior change that appeared recently in commit 0b2af457a49e3b00d47d556d5301934d27909db8 ("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 0b2af457a49e3b00d47d556d5301934d27909db8. 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 <normalperson@yhbt.net>

Eric Wong committed Jul 25, 2009 at 00:00 UTC 6b48829dbbe06798eded1e7c5f70810940591f79
3 files changed +21 -5
Documentation/git-svn.txt
+11
@@ -80,6 +80,17 @@ COMMANDS
80 When passed to 'init' or 'clone' this regular expression will
81 be preserved as a config key. See 'fetch' for a description
82 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).
94
95 'fetch'::
96 Fetch unfetched revisions from the Subversion remote we are
git-svn.perl
+6 -1
@@ -19,6 +19,7 @@ $ENV{GIT_DIR} ||= '.git';
19 $Git::SVN::default_repo_id = 'svn';
20 $Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';
21 $Git::SVN::Ra::_log_window_size = 100;
22 +$Git::SVN::_minimize_url = 'unset';
23
24 $Git::SVN::Log::TZ = $ENV{TZ};
25 $ENV{TZ} = 'UTC';
@@ -100,7 +101,7 @@ my %init_opts = ( 'template=s' => \$_template, 'shared:s' => \$_shared,
101 'trunk|T=s' => \$_trunk, 'tags|t=s@' => \@_tags,
102 'branches|b=s@' => \@_branches, 'prefix=s' => \$_prefix,
103 'stdlayout|s' => \$_stdlayout,
103 - 'minimize-url|m' => \$Git::SVN::_minimize_url,
104 + 'minimize-url|m!' => \$Git::SVN::_minimize_url,
105 'no-metadata' => sub { $icv{noMetadata} = 1 },
106 'use-svm-props' => sub { $icv{useSvmProps} = 1 },
107 'use-svnsync-props' => sub { $icv{useSvnsyncProps} = 1 },
@@ -399,6 +400,10 @@ sub cmd_init {
400 init_subdir(@_);
401 do_git_init_db();
402
403 + if ($Git::SVN::_minimize_url eq 'unset') {
404 + $Git::SVN::_minimize_url = 0;
405 + }
406 +
407 Git::SVN->init($url);
408 }
409
t/t9141-git-svn-multiple-branches.sh
+4 -4
@@ -99,22 +99,22 @@ test_expect_success 'Multiple branch or tag paths require -d' '
99
100 test_expect_success 'create new branches and tags' '
101 ( 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 ) &&
103 ( cd svn_project &&
104 svn_cmd up && test -e b_one/New1/a.file ) &&
105
106 ( 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 ) &&
108 ( cd svn_project &&
109 svn_cmd up && test -e b_two/New2/a.file ) &&
110
111 ( 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 ) &&
113 ( cd svn_project &&
114 svn_cmd up && test -e tags_A/Tag1/a.file ) &&
115
116 ( 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 ) &&
118 ( cd svn_project &&
119 svn_cmd up && test -e tags_B/Tag2/a.file )
120 '