Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given

git-svn by default puts its Subversion-tracking refs directly in refs/remotes/*. This runs counter to Git's convention of using refs/remotes/$remote/* for storing remote-tracking branches. Furthermore, combining git-svn with regular git remotes run the risk of clobbering refs under refs/remotes (e.g. if you have a git remote called "tags" with a "v1" branch, it will overlap with the git-svn's tracking branch for the "v1" tag from Subversion. Even though the git-svn refs stored in refs/remotes/* are not "proper" remote-tracking branches (since they are not covered by a proper git remote's refspec), they clearly represent a similar concept, and would benefit from following the same convention. For example, if git-svn tracks Subversion branch "foo" at refs/remotes/foo, and you create a local branch refs/heads/foo to add some commits to be pushed back to Subversion (using "git svn dcommit), then it is clearly unhelpful of Git to throw warning: refname 'foo' is ambiguous. every time you checkout, rebase, or otherwise interact with the branch. The existing workaround for this is to supply the --prefix=quux/ to git svn init/clone, so that git-svn's tracking branches end up in refs/remotes/quux/* instead of refs/remotes/*. However, encouraging users to specify --prefix to work around a design flaw in git-svn is suboptimal, and not a long term solution to the problem. Instead, git-svn should default to use a non-empty prefix that saves unsuspecting users from the inconveniences described above. This patch will only affect newly created git-svn setups, as the --prefix option only applies to git svn init (and git svn clone). Existing git-svn setups will continue with their existing (lack of) prefix. Also, if anyone somehow prefers git-svn's old layout, they can recreate that by explicitly passing an empty prefix (--prefix "") on the git svn init/clone command line. The patch changes the default value for --prefix from "" to "origin/", updates the git-svn manual page, and fixes the fallout in the git-svn testcases. (Note that this patch might be easier to review using the --word-diff and --word-diff-regex=. diff options.) [ew: squashed description of <= 1.9 behavior into manpage] Suggested-by: Thomas Ferris Nicolaisen <tfnico@gmail.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Eric Wong <normalperson@yhbt.net>

Johan Herland committed Oct 11, 2013 at 14:57 UTC fe191fcaa58cb785c804465a0da9bcba9fd9e822
20 files changed +131 -153
Documentation/git-svn.txt
+4 -16
@@ -86,13 +86,11 @@ COMMANDS
86 (refs/remotes/$remote/*). Setting a prefix is also useful
87 if you wish to track multiple projects that share a common
88 repository.
89 + By default, the prefix is set to 'origin/'.
90 +
90 -NOTE: In Git v2.0, the default prefix will CHANGE from "" (no prefix)
91 -to "origin/". This is done to put SVN-tracking refs at
92 -"refs/remotes/origin/*" instead of "refs/remotes/*", and make them
93 -more compatible with how Git's own remote-tracking refs are organized
94 -(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,
95 -by using the --prefix option.
91 +NOTE: Before Git v2.0, the default prefix was "" (no prefix). This
92 +meant that SVN-tracking refs were put at "refs/remotes/*", which is
93 +incompatible with how Git's own remote-tracking refs are organized.
94
95 --ignore-paths=<regex>;;
96 When passed to 'init' or 'clone' this regular expression will
@@ -994,16 +992,6 @@ without giving any repository layout options. If the full history with
992 branches and tags is required, the options '--trunk' / '--branches' /
993 '--tags' must be used.
994
997 -When using the options for describing the repository layout (--trunk,
998 ---tags, --branches, --stdlayout), please also specify the --prefix
999 -option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be
1000 -placed at refs/remotes/origin/* rather than the default refs/remotes/*.
1001 -The former is more compatible with the layout of Git's "regular"
1002 -remote-tracking refs (refs/remotes/$remote/*), and may potentially
1003 -prevent similarly named SVN branches and Git remotes from clobbering
1004 -each other. In Git v2.0 the default prefix used (i.e. when no --prefix
1005 -is given) will change from "" (no prefix) to "origin/".
1006 -
995 When using multiple --branches or --tags, 'git svn' does not automatically
996 handle name collisions (for example, if two branches from different paths have
997 the same name, or if a branch and a tag have the same name). In these cases,
git-svn.perl
+1 -11
@@ -1389,17 +1389,7 @@ sub cmd_multi_init {
1389 usage(1);
1390 }
1391
1392 - unless (defined $_prefix) {
1393 - $_prefix = '';
1394 - warn <<EOF
1395 -WARNING: --prefix is not given, defaulting to empty prefix.
1396 - This is probably not what you want! In order to stay compatible
1397 - with regular remote-tracking refs, provide a prefix like
1398 - --prefix=origin/ (remember the trailing slash), which will cause
1399 - the SVN-tracking refs to be placed at refs/remotes/origin/*.
1400 -NOTE: In Git v2.0, the default prefix will change from empty to 'origin/'.
1401 -EOF
1402 - }
1392 + $_prefix = 'origin/' unless defined $_prefix;
1393 if (defined $url) {
1394 $url = canonicalize_url($url);
1395 init_subdir(@_);
t/t9107-git-svn-migrate.sh
+27 -27
@@ -45,27 +45,27 @@ test_expect_success 'initialize old-style (v0) git svn layout' '
45 test_expect_success 'initialize a multi-repository repo' '
46 git svn init "$svnrepo" -T trunk -t tags -b branches &&
47 git config --get-all svn-remote.svn.fetch > fetch.out &&
48 - grep "^trunk:refs/remotes/trunk$" fetch.out &&
48 + grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
49 test -n "`git config --get svn-remote.svn.branches \
50 - "^branches/\*:refs/remotes/\*$"`" &&
50 + "^branches/\*:refs/remotes/origin/\*$"`" &&
51 test -n "`git config --get svn-remote.svn.tags \
52 - "^tags/\*:refs/remotes/tags/\*$"`" &&
52 + "^tags/\*:refs/remotes/origin/tags/\*$"`" &&
53 git config --unset svn-remote.svn.branches \
54 - "^branches/\*:refs/remotes/\*$" &&
54 + "^branches/\*:refs/remotes/origin/\*$" &&
55 git config --unset svn-remote.svn.tags \
56 - "^tags/\*:refs/remotes/tags/\*$" &&
57 - git config --add svn-remote.svn.fetch "branches/a:refs/remotes/a" &&
58 - git config --add svn-remote.svn.fetch "branches/b:refs/remotes/b" &&
56 + "^tags/\*:refs/remotes/origin/tags/\*$" &&
57 + git config --add svn-remote.svn.fetch "branches/a:refs/remotes/origin/a" &&
58 + git config --add svn-remote.svn.fetch "branches/b:refs/remotes/origin/b" &&
59 for i in tags/0.1 tags/0.2 tags/0.3; do
60 git config --add svn-remote.svn.fetch \
61 - $i:refs/remotes/$i || exit 1; done &&
61 + $i:refs/remotes/origin/$i || exit 1; done &&
62 git config --get-all svn-remote.svn.fetch > fetch.out &&
63 - grep "^trunk:refs/remotes/trunk$" fetch.out &&
64 - grep "^branches/a:refs/remotes/a$" fetch.out &&
65 - grep "^branches/b:refs/remotes/b$" fetch.out &&
66 - grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
67 - grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
68 - grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out &&
63 + grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
64 + grep "^branches/a:refs/remotes/origin/a$" fetch.out &&
65 + grep "^branches/b:refs/remotes/origin/b$" fetch.out &&
66 + grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
67 + grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
68 + grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
69 grep "^:refs/${remotes_git_svn}" fetch.out
70 '
71
@@ -73,14 +73,14 @@ test_expect_success 'initialize a multi-repository repo' '
73 test_expect_success 'multi-fetch works on partial urls + paths' "
74 git svn multi-fetch &&
75 for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
76 - git rev-parse --verify refs/remotes/\$i^0 >> refs.out || exit 1;
76 + git rev-parse --verify refs/remotes/origin/\$i^0 >> refs.out || exit 1;
77 done &&
78 test -z \"\`sort < refs.out | uniq -d\`\" &&
79 for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
80 for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do
81 if test \$j != \$i; then continue; fi
82 - test -z \"\`git diff refs/remotes/\$i \
83 - refs/remotes/\$j\`\" ||exit 1; done; done
82 + test -z \"\`git diff refs/remotes/origin/\$i \
83 + refs/remotes/origin/\$j\`\" ||exit 1; done; done
84 "
85
86 test_expect_success 'migrate --minimize on old inited layout' '
@@ -98,27 +98,27 @@ test_expect_success 'migrate --minimize on old inited layout' '
98 git svn migrate --minimize &&
99 test -z "`git config -l | grep "^svn-remote\.git-svn\."`" &&
100 git config --get-all svn-remote.svn.fetch > fetch.out &&
101 - grep "^trunk:refs/remotes/trunk$" fetch.out &&
102 - grep "^branches/a:refs/remotes/a$" fetch.out &&
103 - grep "^branches/b:refs/remotes/b$" fetch.out &&
104 - grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
105 - grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
106 - grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out &&
101 + grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
102 + grep "^branches/a:refs/remotes/origin/a$" fetch.out &&
103 + grep "^branches/b:refs/remotes/origin/b$" fetch.out &&
104 + grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
105 + grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
106 + grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
107 grep "^:refs/${remotes_git_svn}" fetch.out
108 '
109
110 test_expect_success ".rev_db auto-converted to .rev_map.UUID" '
111 git svn fetch -i trunk &&
112 - test -z "$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)" &&
113 - expect="$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_map.*)" &&
112 + test -z "$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)" &&
113 + expect="$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_map.*)" &&
114 test -n "$expect" &&
115 rev_db="$(echo $expect | sed -e "s,_map,_db,")" &&
116 convert_to_rev_db "$expect" "$rev_db" &&
117 rm -f "$expect" &&
118 test -f "$rev_db" &&
119 git svn fetch -i trunk &&
120 - test -z "$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)" &&
121 - test ! -e "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db &&
120 + test -z "$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)" &&
121 + test ! -e "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db &&
122 test -f "$expect"
123 '
124
t/t9114-git-svn-dcommit-merge.sh
+2 -2
@@ -48,7 +48,7 @@ test_expect_success 'setup svn repository' '
48 test_expect_success 'setup git mirror and merge' '
49 git svn init "$svnrepo" -t tags -T trunk -b branches &&
50 git svn fetch &&
51 - git checkout -b svn remotes/trunk &&
51 + git checkout -b svn remotes/origin/trunk &&
52 git checkout -b merge &&
53 echo new file > new_file &&
54 git add new_file &&
@@ -81,7 +81,7 @@ test_debug 'gitk --all & sleep 1'
81
82 test_expect_success 'verify post-merge ancestry' "
83 test x\`git rev-parse --verify refs/heads/svn\` = \
84 - x\`git rev-parse --verify refs/remotes/trunk \` &&
84 + x\`git rev-parse --verify refs/remotes/origin/trunk \` &&
85 test x\`git rev-parse --verify refs/heads/svn^2\` = \
86 x\`git rev-parse --verify refs/heads/merge\` &&
87 git cat-file commit refs/heads/svn^ | grep '^friend$'
t/t9116-git-svn-log.sh
+23 -23
@@ -20,20 +20,20 @@ test_expect_success 'setup repository and import' '
20 ) &&
21 git svn init "$svnrepo" -T trunk -b branches -t tags &&
22 git svn fetch &&
23 - git reset --hard trunk &&
23 + git reset --hard origin/trunk &&
24 echo bye >> README &&
25 git commit -a -m bye &&
26 git svn dcommit &&
27 - git reset --hard a &&
27 + git reset --hard origin/a &&
28 echo why >> FEEDME &&
29 git update-index --add FEEDME &&
30 git commit -m feedme &&
31 git svn dcommit &&
32 - git reset --hard trunk &&
32 + git reset --hard origin/trunk &&
33 echo aye >> README &&
34 git commit -a -m aye &&
35 git svn dcommit &&
36 - git reset --hard b &&
36 + git reset --hard origin/b &&
37 echo spy >> README &&
38 git commit -a -m spy &&
39 echo try >> README &&
@@ -42,26 +42,26 @@ test_expect_success 'setup repository and import' '
42 '
43
44 test_expect_success 'run log' "
45 - git reset --hard a &&
46 - git svn log -r2 trunk | grep ^r2 &&
47 - git svn log -r4 trunk | grep ^r4 &&
45 + git reset --hard origin/a &&
46 + git svn log -r2 origin/trunk | grep ^r2 &&
47 + git svn log -r4 origin/trunk | grep ^r4 &&
48 git svn log -r3 | grep ^r3
49 "
50
51 test_expect_success 'run log against a from trunk' "
52 - git reset --hard trunk &&
53 - git svn log -r3 a | grep ^r3
52 + git reset --hard origin/trunk &&
53 + git svn log -r3 origin/a | grep ^r3
54 "
55
56 printf 'r1 \nr2 \nr4 \n' > expected-range-r1-r2-r4
57
58 test_expect_success 'test ascending revision range' "
59 - git reset --hard trunk &&
59 + git reset --hard origin/trunk &&
60 git svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
61 "
62
63 test_expect_success 'test ascending revision range with --show-commit' "
64 - git reset --hard trunk &&
64 + git reset --hard origin/trunk &&
65 git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
66 "
67
@@ -69,7 +69,7 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' "
69 git svn find-rev r1 >expected-range-r1-r2-r4-sha1 &&
70 git svn find-rev r2 >>expected-range-r1-r2-r4-sha1 &&
71 git svn find-rev r4 >>expected-range-r1-r2-r4-sha1 &&
72 - git reset --hard trunk &&
72 + git reset --hard origin/trunk &&
73 git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f2 >out &&
74 git rev-parse \$(cat out) >actual &&
75 test_cmp expected-range-r1-r2-r4-sha1 actual
@@ -78,67 +78,67 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' "
78 printf 'r4 \nr2 \nr1 \n' > expected-range-r4-r2-r1
79
80 test_expect_success 'test descending revision range' "
81 - git reset --hard trunk &&
81 + git reset --hard origin/trunk &&
82 git svn log -r 4:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4-r2-r1 -
83 "
84
85 printf 'r1 \nr2 \n' > expected-range-r1-r2
86
87 test_expect_success 'test ascending revision range with unreachable revision' "
88 - git reset --hard trunk &&
88 + git reset --hard origin/trunk &&
89 git svn log -r 1:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2 -
90 "
91
92 printf 'r2 \nr1 \n' > expected-range-r2-r1
93
94 test_expect_success 'test descending revision range with unreachable revision' "
95 - git reset --hard trunk &&
95 + git reset --hard origin/trunk &&
96 git svn log -r 3:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2-r1 -
97 "
98
99 printf 'r2 \n' > expected-range-r2
100
101 test_expect_success 'test ascending revision range with unreachable upper boundary revision and 1 commit' "
102 - git reset --hard trunk &&
102 + git reset --hard origin/trunk &&
103 git svn log -r 2:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -
104 "
105
106 test_expect_success 'test descending revision range with unreachable upper boundary revision and 1 commit' "
107 - git reset --hard trunk &&
107 + git reset --hard origin/trunk &&
108 git svn log -r 3:2 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -
109 "
110
111 printf 'r4 \n' > expected-range-r4
112
113 test_expect_success 'test ascending revision range with unreachable lower boundary revision and 1 commit' "
114 - git reset --hard trunk &&
114 + git reset --hard origin/trunk &&
115 git svn log -r 3:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
116 "
117
118 test_expect_success 'test descending revision range with unreachable lower boundary revision and 1 commit' "
119 - git reset --hard trunk &&
119 + git reset --hard origin/trunk &&
120 git svn log -r 4:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
121 "
122
123 printf -- '------------------------------------------------------------------------\n' > expected-separator
124
125 test_expect_success 'test ascending revision range with unreachable boundary revisions and no commits' "
126 - git reset --hard trunk &&
126 + git reset --hard origin/trunk &&
127 git svn log -r 5:6 | test_cmp expected-separator -
128 "
129
130 test_expect_success 'test descending revision range with unreachable boundary revisions and no commits' "
131 - git reset --hard trunk &&
131 + git reset --hard origin/trunk &&
132 git svn log -r 6:5 | test_cmp expected-separator -
133 "
134
135 test_expect_success 'test ascending revision range with unreachable boundary revisions and 1 commit' "
136 - git reset --hard trunk &&
136 + git reset --hard origin/trunk &&
137 git svn log -r 3:5 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
138 "
139
140 test_expect_success 'test descending revision range with unreachable boundary revisions and 1 commit' "
141 - git reset --hard trunk &&
141 + git reset --hard origin/trunk &&
142 git svn log -r 5:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
143 "
144
t/t9117-git-svn-init-clone.sh
+8 -8
@@ -83,25 +83,25 @@ EOF
83 rm -f expect actual
84 }
85
86 -test_expect_success 'init with -s/-T/-b/-t without --prefix warns' '
86 +test_expect_success 'init with -s/-T/-b/-t assumes --prefix=origin/' '
87 test ! -d project &&
88 git svn init -s "$svnrepo"/project project 2>warning &&
89 - grep -q prefix warning &&
90 - test_svn_configured_prefix "" &&
89 + test_must_fail grep -q prefix warning &&
90 + test_svn_configured_prefix "origin/" &&
91 rm -rf project &&
92 rm -f warning
93 '
94
95 -test_expect_success 'clone with -s/-T/-b/-t without --prefix warns' '
95 +test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' '
96 test ! -d project &&
97 git svn clone -s "$svnrepo"/project 2>warning &&
98 - grep -q prefix warning &&
99 - test_svn_configured_prefix "" &&
98 + test_must_fail grep -q prefix warning &&
99 + test_svn_configured_prefix "origin/" &&
100 rm -rf project &&
101 rm -f warning
102 '
103
104 -test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '
104 +test_expect_success 'init with -s/-T/-b/-t and --prefix="" still works' '
105 test ! -d project &&
106 git svn init -s "$svnrepo"/project project --prefix="" 2>warning &&
107 test_must_fail grep -q prefix warning &&
@@ -110,7 +110,7 @@ test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '
110 rm -f warning
111 '
112
113 -test_expect_success 'clone with -s/-T/-b/-t and --prefix does not warn' '
113 +test_expect_success 'clone with -s/-T/-b/-t and --prefix="" still works' '
114 test ! -d project &&
115 git svn clone -s "$svnrepo"/project --prefix="" 2>warning &&
116 test_must_fail grep -q prefix warning &&
t/t9118-git-svn-funky-branch-names.sh
+10 -10
@@ -41,20 +41,20 @@ test_expect_success 'test clone with funky branch names' '
41 git svn clone -s "$svnrepo/pr ject" project &&
42 (
43 cd project &&
44 - git rev-parse "refs/remotes/fun%20plugin" &&
45 - git rev-parse "refs/remotes/more%20fun%20plugin!" &&
46 - git rev-parse "refs/remotes/$scary_ref" &&
47 - git rev-parse "refs/remotes/%2Eleading_dot" &&
48 - git rev-parse "refs/remotes/trailing_dot%2E" &&
49 - git rev-parse "refs/remotes/trailing_dotlock%2Elock" &&
50 - git rev-parse "refs/remotes/$non_reflog"
44 + git rev-parse "refs/remotes/origin/fun%20plugin" &&
45 + git rev-parse "refs/remotes/origin/more%20fun%20plugin!" &&
46 + git rev-parse "refs/remotes/origin/$scary_ref" &&
47 + git rev-parse "refs/remotes/origin/%2Eleading_dot" &&
48 + git rev-parse "refs/remotes/origin/trailing_dot%2E" &&
49 + git rev-parse "refs/remotes/origin/trailing_dotlock%2Elock" &&
50 + git rev-parse "refs/remotes/origin/$non_reflog"
51 )
52 '
53
54 test_expect_success 'test dcommit to funky branch' "
55 (
56 cd project &&
57 - git reset --hard 'refs/remotes/more%20fun%20plugin!' &&
57 + git reset --hard 'refs/remotes/origin/more%20fun%20plugin!' &&
58 echo hello >> foo &&
59 git commit -m 'hello' -- foo &&
60 git svn dcommit
@@ -64,7 +64,7 @@ test_expect_success 'test dcommit to funky branch' "
64 test_expect_success 'test dcommit to scary branch' '
65 (
66 cd project &&
67 - git reset --hard "refs/remotes/$scary_ref" &&
67 + git reset --hard "refs/remotes/origin/$scary_ref" &&
68 echo urls are scary >> foo &&
69 git commit -m "eep" -- foo &&
70 git svn dcommit
@@ -74,7 +74,7 @@ test_expect_success 'test dcommit to scary branch' '
74 test_expect_success 'test dcommit to trailing_dotlock branch' '
75 (
76 cd project &&
77 - git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
77 + git reset --hard "refs/remotes/origin/trailing_dotlock%2Elock" &&
78 echo who names branches like this anyway? >> foo &&
79 git commit -m "bar" -- foo &&
80 git svn dcommit
t/t9120-git-svn-clone-with-percent-escapes.sh
+7 -7
@@ -58,19 +58,19 @@ test_expect_success 'test clone --stdlayout with percent escapes' '
58 git svn clone --stdlayout "$svnrepo/pr%20ject" percent &&
59 (
60 cd percent &&
61 - git rev-parse refs/remotes/trunk^0 &&
62 - git rev-parse refs/remotes/b^0 &&
63 - git rev-parse refs/remotes/tags/v1^0
61 + git rev-parse refs/remotes/origin/trunk^0 &&
62 + git rev-parse refs/remotes/origin/b^0 &&
63 + git rev-parse refs/remotes/origin/tags/v1^0
64 )
65 '
66
67 test_expect_success 'test clone -s with unescaped space' '
68 - git svn clone -s "$svnrepo/pr ject" space &&
68 + git svn clone -s "$svnrepo/pr ject" --prefix origin/ space &&
69 (
70 cd space &&
71 - git rev-parse refs/remotes/trunk^0 &&
72 - git rev-parse refs/remotes/b^0 &&
73 - git rev-parse refs/remotes/tags/v1^0
71 + git rev-parse refs/remotes/origin/trunk^0 &&
72 + git rev-parse refs/remotes/origin/b^0 &&
73 + git rev-parse refs/remotes/origin/tags/v1^0
74 )
75 '
76
t/t9125-git-svn-multi-glob-branch-names.sh
+3 -3
@@ -20,14 +20,14 @@ test_expect_success 'test clone with multi-glob in branch names' '
20 git svn clone -T trunk -b branches/*/* -t tags \
21 "$svnrepo/project" project &&
22 (cd project &&
23 - git rev-parse "refs/remotes/v14.1/beta" &&
24 - git rev-parse "refs/remotes/v14.1/gold"
23 + git rev-parse "refs/remotes/origin/v14.1/beta" &&
24 + git rev-parse "refs/remotes/origin/v14.1/gold"
25 )
26 '
27
28 test_expect_success 'test dcommit to multi-globbed branch' "
29 (cd project &&
30 - git reset --hard 'refs/remotes/v14.1/gold' &&
30 + git reset --hard 'refs/remotes/origin/v14.1/gold' &&
31 echo hello >> foo &&
32 git commit -m 'hello' -- foo &&
33 git svn dcommit
t/t9128-git-svn-cmd-branch.sh
+9 -9
@@ -29,30 +29,30 @@ test_expect_success 'initialize svnrepo' '
29 test_expect_success 'import into git' '
30 git svn init --stdlayout "$svnrepo" &&
31 git svn fetch &&
32 - git checkout remotes/trunk
32 + git checkout remotes/origin/trunk
33 '
34
35 test_expect_success 'git svn branch tests' '
36 git svn branch a &&
37 base=$(git rev-parse HEAD:) &&
38 - test $base = $(git rev-parse remotes/a:) &&
38 + test $base = $(git rev-parse remotes/origin/a:) &&
39 git svn branch -m "created branch b blah" b &&
40 - test $base = $(git rev-parse remotes/b:) &&
40 + test $base = $(git rev-parse remotes/origin/b:) &&
41 test_must_fail git branch -m "no branchname" &&
42 git svn branch -n c &&
43 - test_must_fail git rev-parse remotes/c &&
43 + test_must_fail git rev-parse remotes/origin/c &&
44 test_must_fail git svn branch a &&
45 git svn branch -t tag1 &&
46 - test $base = $(git rev-parse remotes/tags/tag1:) &&
46 + test $base = $(git rev-parse remotes/origin/tags/tag1:) &&
47 git svn branch --tag tag2 &&
48 - test $base = $(git rev-parse remotes/tags/tag2:) &&
48 + test $base = $(git rev-parse remotes/origin/tags/tag2:) &&
49 git svn tag tag3 &&
50 - test $base = $(git rev-parse remotes/tags/tag3:) &&
50 + test $base = $(git rev-parse remotes/origin/tags/tag3:) &&
51 git svn tag -m "created tag4 foo" tag4 &&
52 - test $base = $(git rev-parse remotes/tags/tag4:) &&
52 + test $base = $(git rev-parse remotes/origin/tags/tag4:) &&
53 test_must_fail git svn tag -m "no tagname" &&
54 git svn tag -n tag5 &&
55 - test_must_fail git rev-parse remotes/tags/tag5 &&
55 + test_must_fail git rev-parse remotes/origin/tags/tag5 &&
56 test_must_fail git svn tag tag1
57 '
58
t/t9135-git-svn-moved-branch-empty-file.sh
+1 -1
@@ -12,7 +12,7 @@ test_expect_success 'clone using git svn' 'git svn clone -s "$svnrepo" x'
12 test_expect_success 'test that b1 exists and is empty' '
13 (
14 cd x &&
15 - git reset --hard branch-c &&
15 + git reset --hard origin/branch-c &&
16 test -f b1 &&
17 ! test -s b1
18 )
t/t9141-git-svn-multiple-branches.sh
+14 -14
@@ -66,18 +66,18 @@ test_expect_success 'clone multiple branch and tag paths' '
66 -t tags_A/* --tags tags_B \
67 "$svnrepo/project" git_project &&
68 ( cd git_project &&
69 - git rev-parse refs/remotes/first &&
70 - git rev-parse refs/remotes/second &&
71 - git rev-parse refs/remotes/1 &&
72 - git rev-parse refs/remotes/2 &&
73 - git rev-parse refs/remotes/tags/1.0 &&
74 - git rev-parse refs/remotes/tags/2.0 &&
75 - git rev-parse refs/remotes/tags/3.0 &&
76 - git rev-parse refs/remotes/tags/4.0 &&
77 - git rev-parse refs/remotes/tags/v5 &&
78 - git rev-parse refs/remotes/tags/v6 &&
79 - git rev-parse refs/remotes/tags/v7 &&
80 - git rev-parse refs/remotes/tags/v8
69 + git rev-parse refs/remotes/origin/first &&
70 + git rev-parse refs/remotes/origin/second &&
71 + git rev-parse refs/remotes/origin/1 &&
72 + git rev-parse refs/remotes/origin/2 &&
73 + git rev-parse refs/remotes/origin/tags/1.0 &&
74 + git rev-parse refs/remotes/origin/tags/2.0 &&
75 + git rev-parse refs/remotes/origin/tags/3.0 &&
76 + git rev-parse refs/remotes/origin/tags/4.0 &&
77 + git rev-parse refs/remotes/origin/tags/v5 &&
78 + git rev-parse refs/remotes/origin/tags/v6 &&
79 + git rev-parse refs/remotes/origin/tags/v7 &&
80 + git rev-parse refs/remotes/origin/tags/v8
81 )
82 '
83
@@ -85,8 +85,8 @@ test_expect_success 'Multiple branch or tag paths require -d' '
85 ( cd git_project &&
86 test_must_fail git svn branch -m "No new branch" Nope &&
87 test_must_fail git svn tag -m "No new tag" Tagless &&
88 - test_must_fail git rev-parse refs/remotes/Nope &&
89 - test_must_fail git rev-parse refs/remotes/tags/Tagless
88 + test_must_fail git rev-parse refs/remotes/origin/Nope &&
89 + test_must_fail git rev-parse refs/remotes/origin/tags/Tagless
90 ) &&
91 ( cd svn_project &&
92 svn_cmd up &&
t/t9145-git-svn-master-branch.sh
+1 -1
@@ -17,7 +17,7 @@ test_expect_success 'git svn clone --stdlayout sets up trunk as master' '
17 git svn clone -s "$svnrepo" g &&
18 (
19 cd g &&
20 - test x`git rev-parse --verify refs/remotes/trunk^0` = \
20 + test x`git rev-parse --verify refs/remotes/origin/trunk^0` = \
21 x`git rev-parse --verify refs/heads/master^0`
22 )
23 '
t/t9155-git-svn-fetch-deleted-tag.sh
+2 -2
@@ -35,8 +35,8 @@ test_expect_success 'fetch deleted tags from same revision with checksum error'
35 cd git_project &&
36 git svn fetch &&
37
38 - git diff --exit-code mybranch:trunk/subdir/file tags/mytag:file &&
39 - git diff --exit-code master:subdir/file tags/mytag^:file
38 + git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
39 + git diff --exit-code master:subdir/file origin/tags/mytag^:file
40 '
41
42 test_done
t/t9156-git-svn-fetch-deleted-tag-2.sh
+3 -3
@@ -36,9 +36,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro
36 cd git_project &&
37 git svn fetch &&
38
39 - git diff --exit-code master:subdir3/file tags/mytag:file &&
40 - git diff --exit-code master:subdir2/file tags/mytag^:file &&
41 - git diff --exit-code master:subdir1/file tags/mytag^^:file
39 + git diff --exit-code master:subdir3/file origin/tags/mytag:file &&
40 + git diff --exit-code master:subdir2/file origin/tags/mytag^:file &&
41 + git diff --exit-code master:subdir1/file origin/tags/mytag^^:file
42 '
43
44 test_done
t/t9161-git-svn-mergeinfo-push.sh
+11 -11
@@ -18,8 +18,8 @@ test_expect_success 'load svn dump' "
18
19 test_expect_success 'propagate merge information' '
20 git config svn.pushmergeinfo yes &&
21 - git checkout svnb1 &&
22 - git merge --no-ff svnb2 &&
21 + git checkout origin/svnb1 &&
22 + git merge --no-ff origin/svnb2 &&
23 git svn dcommit
24 '
25
@@ -29,7 +29,7 @@ test_expect_success 'check svn:mergeinfo' '
29 '
30
31 test_expect_success 'merge another branch' '
32 - git merge --no-ff svnb3 &&
32 + git merge --no-ff origin/svnb3 &&
33 git svn dcommit
34 '
35
@@ -40,7 +40,7 @@ test_expect_success 'check primary parent mergeinfo respected' '
40 '
41
42 test_expect_success 'merge existing merge' '
43 - git merge --no-ff svnb4 &&
43 + git merge --no-ff origin/svnb4 &&
44 git svn dcommit
45 '
46
@@ -53,7 +53,7 @@ test_expect_success "check both parents' mergeinfo respected" '
53 '
54
55 test_expect_success 'make further commits to branch' '
56 - git checkout svnb2 &&
56 + git checkout origin/svnb2 &&
57 touch newb2file &&
58 git add newb2file &&
59 git commit -m "later b2 commit" &&
@@ -64,8 +64,8 @@ test_expect_success 'make further commits to branch' '
64 '
65
66 test_expect_success 'second forward merge' '
67 - git checkout svnb1 &&
68 - git merge --no-ff svnb2 &&
67 + git checkout origin/svnb1 &&
68 + git merge --no-ff origin/svnb2 &&
69 git svn dcommit
70 '
71
@@ -78,8 +78,8 @@ test_expect_success 'check new mergeinfo added' '
78 '
79
80 test_expect_success 'reintegration merge' '
81 - git checkout svnb4 &&
82 - git merge --no-ff svnb1 &&
81 + git checkout origin/svnb4 &&
82 + git merge --no-ff origin/svnb1 &&
83 git svn dcommit
84 '
85
@@ -92,11 +92,11 @@ test_expect_success 'check reintegration mergeinfo' '
92 '
93
94 test_expect_success 'dcommit a merge at the top of a stack' '
95 - git checkout svnb1 &&
95 + git checkout origin/svnb1 &&
96 touch anotherfile &&
97 git add anotherfile &&
98 git commit -m "a commit" &&
99 - git merge svnb4 &&
99 + git merge origin/svnb4 &&
100 git svn dcommit
101 '
102
t/t9163-git-svn-reset-clears-caches.sh
+2 -2
@@ -70,9 +70,9 @@ test_expect_success 'rebase looses SVN merge (m)' '
70 #
71 test_expect_success 'reset and fetch gets the SVN merge (m) correctly' '
72 git svn reset -r 3 &&
73 - git reset --hard trunk &&
73 + git reset --hard origin/trunk &&
74 git svn fetch &&
75 - test 2 = $(git cat-file -p trunk|grep parent|wc -l)
75 + test 2 = $(git cat-file -p origin/trunk|grep parent|wc -l)
76 '
77
78 test_done
t/t9165-git-svn-fetch-merge-branch-of-branch.sh
+1 -1
@@ -53,7 +53,7 @@ test_expect_success 'clone svn repo' '
53 '
54
55 test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&
56 - y=$(git rev-parse branch2) &&
56 + y=$(git rev-parse origin/branch2) &&
57 test "x$x" = "x$y"
58 '
59
t/t9166-git-svn-fetch-merge-branch-of-branch2.sh
+1 -1
@@ -46,7 +46,7 @@ test_expect_success 'clone svn repo' '
46 '
47
48 test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&
49 - y=$(git rev-parse branch2) &&
49 + y=$(git rev-parse origin/branch2) &&
50 test "x$x" = "x$y"
51 '
52
t/t9167-git-svn-cmd-branch-subproject.sh
+1 -1
@@ -31,7 +31,7 @@ test_expect_success 'import into git' '
31 git svn init --trunk=trunk/project --branches=branches/*/project \
32 --tags=tags/*/project "$svnrepo" &&
33 git svn fetch &&
34 - git checkout remotes/trunk
34 + git checkout remotes/origin/trunk
35 '
36
37 test_expect_success 'git svn branch tests' '