git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git-svn: Use prefix by default?
@ 2013-08-22  9:02 Thomas Ferris Nicolaisen
  2013-09-30 22:39 ` Johan Herland
  0 siblings, 1 reply; 23+ messages in thread
From: Thomas Ferris Nicolaisen @ 2013-08-22  9:02 UTC (permalink / raw)
  To: git@vger.kernel.org

I've recently been forced back into using git-svn, and while I was at
it, I noticed that git-svn generally behaves a lot better when it is
initialized using the --prefix option.

For example, I make a standard-layout svn clone:

$ git svn clone -s https://svn.company.com/repos/project-foo/

.. and end up with this .gitconfig:

[svn-remote "svn"]
        url = https://svn.company.com/repos/
        fetch = project-foo/trunk:refs/remotes/trunk
        branches = project-foo/branches/*:refs/remotes/*
        tags = project-foo/tags/*:refs/remotes/tags/*

And my remote branches looks like this:
    remotes/trunk
    remotes/feat-bar

Now, let's say I want to work on the feat-bar branch, so I attempt to
create a tracking branch by the same name:

$ git checkout feat-bar  # will detach head
$ git checkout remotes/feat-bar  # will detach head
$ git checkout -t remotes/feat-bar # fatal: Missing branch name; try -b
$ git checkout -tb remotes/feat-bar # Branch remotes/feat-bar set up
to track local branch master.

Well, that's not what I wanted.. So I end up doing it the good
old-fashioned way:

$ git checkout -tb feat-bar remotes/feat-bar # works

Now I am up and rolling, but I get this warning with every checkout or rebase:

     warning: refname 'feat-bar' is ambiguous.

So, let's see what happens when I create the svn clone using a
--prefix=mirror/ instead. Here's the config:

[svn-remote "svn"]
        url = https://svn.company.com/repos/
        fetch = project-foo/trunk:refs/remotes/mirror/trunk
        branches = project-foo/branches/*:refs/remotes/mirror/*
        tags = project-foo/tags/*:refs/remotes/mirror/tags/*

Here are my remote branches:
     remotes/mirror/trunk
     remotes/mirror/feat-bar

Let's create the tracking branch:

$ git checkout feat-bar  # Branch feat-bar set up to track remote
branch feat-bar from mirror.

Voila, worked on the first try. And no more warnings about ambiguous refnames.

So now my question is: If using a prefix is so healthy for git's
branch tracking conventions, why doesn't git-svn default to use some
prefix like 'origin' or something when initializing a git svn clone?

The examples were made using 1.8.1.2 on OSX by the way.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: git-svn: Use prefix by default?
  2013-08-22  9:02 git-svn: Use prefix by default? Thomas Ferris Nicolaisen
@ 2013-09-30 22:39 ` Johan Herland
  2013-09-30 22:46   ` [RFC/PATCH] git svn: Set default --prefix='origin/' if --prefix is not given Johan Herland
  0 siblings, 1 reply; 23+ messages in thread
From: Johan Herland @ 2013-09-30 22:39 UTC (permalink / raw)
  To: Thomas Ferris Nicolaisen; +Cc: git@vger.kernel.org

On Thu, Aug 22, 2013 at 11:02 AM, Thomas Ferris Nicolaisen
<tfnico@gmail.com> wrote:
> I've recently been forced back into using git-svn, and while I was at
> it, I noticed that git-svn generally behaves a lot better when it is
> initialized using the --prefix option.

Thanks for raising this issue. Although I'm not using git-svn myself,
I have been aware of how git-svn pollutes the refs/remote/* namespace
for a while. In addition to being messy, it causes potential problems
for the remote ref namespaces being discussed in other threads.
The issue is even recognized by the git-svn author (see e.g.
http://www.mail-archive.com/git@vger.kernel.org/msg26248.html ).

I have some bad news, and some good news for you. Read on...

> For example, I make a standard-layout svn clone:
>
> $ git svn clone -s https://svn.company.com/repos/project-foo/
>
> .. and end up with this .gitconfig:
>
> [svn-remote "svn"]
>         url = https://svn.company.com/repos/
>         fetch = project-foo/trunk:refs/remotes/trunk
>         branches = project-foo/branches/*:refs/remotes/*
>         tags = project-foo/tags/*:refs/remotes/tags/*
>
> And my remote branches looks like this:
>     remotes/trunk
>     remotes/feat-bar
>
> Now, let's say I want to work on the feat-bar branch, so I attempt to
> create a tracking branch by the same name:
>
> $ git checkout feat-bar  # will detach head
> $ git checkout remotes/feat-bar  # will detach head
> $ git checkout -t remotes/feat-bar # fatal: Missing branch name; try -b
> $ git checkout -tb remotes/feat-bar # Branch remotes/feat-bar set up
> to track local branch master.
>
> Well, that's not what I wanted.. So I end up doing it the good
> old-fashioned way:
>
> $ git checkout -tb feat-bar remotes/feat-bar # works

The bad news is that the upstream relationship you're trying to create
between your local feat-bar and git-svn's remotes/feat-bar is not a
valid upstream relationship.

An upstream relationship in Git is encoded in the branch.foo.remote and
branch.foo.merge configuration variables. These specify the name of the
upstream remote, and which branch at that remote to pull from,
respectively. However, in your case, there is no git remote associated
with refs/remotes/feat-bar (nor with refs/remotes/mirror/feat-bar which
you create below), and hence there is no valid remote name to assign to
branch.feat-bar.remote.

Prior to v1.8.3.2 this still sort-of works (as you observe below),
because the code fails to realize the remote is invalid, and falls back
to setting branch.feat-bar.remote = "." (i.e. the current repo). This
might seem like an ok practice until you realize that a "git push" back
to that invalid upstream would happily overwrite
refs/remotes/(mirror/)feat-bar, and thus break git-svn's internal state.

This bug was fixed in v1.8.3.2, more specifically 41c21f22 (branch.c:
Validate tracking branches with refspecs instead of refs/remotes/*),
and you can read more about the rationale in that commit message.

The end result for you is that setting up your local feat-bar to track
git-svn's feat-bar will no longer be accepted once you upgrade to >=
v1.8.3.2. The correct way to set up a local feat-bar branch to work on
top of git-svn's feat-bar is instead to forgo the upstream relationship
and simply do "git checkout -b feat-bar refs/remotes/(mirror/)feat-bar".

> Now I am up and rolling, but I get this warning with every checkout or rebase:
>
>      warning: refname 'feat-bar' is ambiguous.
>
> So, let's see what happens when I create the svn clone using a
> --prefix=mirror/ instead. Here's the config:
>
> [svn-remote "svn"]
>         url = https://svn.company.com/repos/
>         fetch = project-foo/trunk:refs/remotes/mirror/trunk
>         branches = project-foo/branches/*:refs/remotes/mirror/*
>         tags = project-foo/tags/*:refs/remotes/mirror/tags/*
>
> Here are my remote branches:
>      remotes/mirror/trunk
>      remotes/mirror/feat-bar
>
> Let's create the tracking branch:
>
> $ git checkout feat-bar  # Branch feat-bar set up to track remote
> branch feat-bar from mirror.

As I explained above, this no longer works in >= v1.8.3.2...

> Voila, worked on the first try. And no more warnings about ambiguous refnames.

...but the warning about ambiguous refnames can and should be fixed,
by making git-svn's --prefix default to adding an extra level below
refs/remotes.

> So now my question is: If using a prefix is so healthy for git's
> branch tracking conventions, why doesn't git-svn default to use some
> prefix like 'origin' or something when initializing a git svn clone?

Exactly, and the good news is that I finally got around to writing that
patch, which I'll post in a minute...


Hope this helps,

...Johan

--
Johan Herland, <johan@herland.net>
www.herland.net

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [RFC/PATCH] git svn: Set default --prefix='origin/' if --prefix is not given
  2013-09-30 22:39 ` Johan Herland
@ 2013-09-30 22:46   ` Johan Herland
  2013-10-01  4:07     ` Eric Wong
  0 siblings, 1 reply; 23+ messages in thread
From: Johan Herland @ 2013-09-30 22:46 UTC (permalink / raw)
  To: git; +Cc: tfnico, Johan Herland, Eric Wong

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, git-svn could
be a little more proactive and default to 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
is set up by 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 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.)

Suggested-by: Thomas Ferris Nicolaisen <tfnico@gmail.com>
Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
---
 Documentation/git-svn.txt                        |  1 +
 git-svn.perl                                     |  2 +-
 t/t9107-git-svn-migrate.sh                       | 54 ++++++++++++------------
 t/t9114-git-svn-dcommit-merge.sh                 |  4 +-
 t/t9116-git-svn-log.sh                           | 46 ++++++++++----------
 t/t9118-git-svn-funky-branch-names.sh            | 20 ++++-----
 t/t9120-git-svn-clone-with-percent-escapes.sh    | 14 +++---
 t/t9125-git-svn-multi-glob-branch-names.sh       |  6 +--
 t/t9128-git-svn-cmd-branch.sh                    | 18 ++++----
 t/t9135-git-svn-moved-branch-empty-file.sh       |  2 +-
 t/t9141-git-svn-multiple-branches.sh             | 28 ++++++------
 t/t9145-git-svn-master-branch.sh                 |  2 +-
 t/t9155-git-svn-fetch-deleted-tag.sh             |  4 +-
 t/t9156-git-svn-fetch-deleted-tag-2.sh           |  6 +--
 t/t9161-git-svn-mergeinfo-push.sh                | 22 +++++-----
 t/t9163-git-svn-reset-clears-caches.sh           |  4 +-
 t/t9165-git-svn-fetch-merge-branch-of-branch.sh  |  2 +-
 t/t9166-git-svn-fetch-merge-branch-of-branch2.sh |  2 +-
 t/t9167-git-svn-cmd-branch-subproject.sh         |  2 +-
 19 files changed, 120 insertions(+), 119 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 4dd3bcb..17f5803 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -81,6 +81,7 @@ COMMANDS
 	specified, the prefix must include a trailing slash.
 	Setting a prefix is useful if you wish to track multiple
 	projects that share a common repository.
+	By default, the prefix is set to 'origin/'.
 --ignore-paths=<regex>;;
 	When passed to 'init' or 'clone' this regular expression will
 	be preserved as a config key.  See 'fetch' for a description
diff --git a/git-svn.perl b/git-svn.perl
index ff1ce3d..ad3fe66 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1389,7 +1389,7 @@ sub cmd_multi_init {
 		usage(1);
 	}
 
-	$_prefix = '' unless defined $_prefix;
+	$_prefix = 'origin/' unless defined $_prefix;
 	if (defined $url) {
 		$url = canonicalize_url($url);
 		init_subdir(@_);
diff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh
index ee73013..6e69fc4 100755
--- a/t/t9107-git-svn-migrate.sh
+++ b/t/t9107-git-svn-migrate.sh
@@ -45,27 +45,27 @@ test_expect_success 'initialize old-style (v0) git svn layout' '
 test_expect_success 'initialize a multi-repository repo' '
 	git svn init "$svnrepo" -T trunk -t tags -b branches &&
 	git config --get-all svn-remote.svn.fetch > fetch.out &&
-	grep "^trunk:refs/remotes/trunk$" fetch.out &&
+	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
 	test -n "`git config --get svn-remote.svn.branches \
-	            "^branches/\*:refs/remotes/\*$"`" &&
+	            "^branches/\*:refs/remotes/origin/\*$"`" &&
 	test -n "`git config --get svn-remote.svn.tags \
-	            "^tags/\*:refs/remotes/tags/\*$"`" &&
+	            "^tags/\*:refs/remotes/origin/tags/\*$"`" &&
 	git config --unset svn-remote.svn.branches \
-	                        "^branches/\*:refs/remotes/\*$" &&
+	                        "^branches/\*:refs/remotes/origin/\*$" &&
 	git config --unset svn-remote.svn.tags \
-	                        "^tags/\*:refs/remotes/tags/\*$" &&
-	git config --add svn-remote.svn.fetch "branches/a:refs/remotes/a" &&
-	git config --add svn-remote.svn.fetch "branches/b:refs/remotes/b" &&
+	                        "^tags/\*:refs/remotes/origin/tags/\*$" &&
+	git config --add svn-remote.svn.fetch "branches/a:refs/remotes/origin/a" &&
+	git config --add svn-remote.svn.fetch "branches/b:refs/remotes/origin/b" &&
 	for i in tags/0.1 tags/0.2 tags/0.3; do
 		git config --add svn-remote.svn.fetch \
-		                 $i:refs/remotes/$i || exit 1; done &&
+		                 $i:refs/remotes/origin/$i || exit 1; done &&
 	git config --get-all svn-remote.svn.fetch > fetch.out &&
-	grep "^trunk:refs/remotes/trunk$" fetch.out &&
-	grep "^branches/a:refs/remotes/a$" fetch.out &&
-	grep "^branches/b:refs/remotes/b$" fetch.out &&
-	grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
-	grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
-	grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out &&
+	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
+	grep "^branches/a:refs/remotes/origin/a$" fetch.out &&
+	grep "^branches/b:refs/remotes/origin/b$" fetch.out &&
+	grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
+	grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
+	grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
 	grep "^:refs/${remotes_git_svn}" fetch.out
 	'
 
@@ -73,14 +73,14 @@ test_expect_success 'initialize a multi-repository repo' '
 test_expect_success 'multi-fetch works on partial urls + paths' "
 	git svn multi-fetch &&
 	for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
-		git rev-parse --verify refs/remotes/\$i^0 >> refs.out || exit 1;
+		git rev-parse --verify refs/remotes/origin/\$i^0 >> refs.out || exit 1;
 	    done &&
 	test -z \"\`sort < refs.out | uniq -d\`\" &&
 	for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
 	  for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do
 		if test \$j != \$i; then continue; fi
-	    test -z \"\`git diff refs/remotes/\$i \
-	                         refs/remotes/\$j\`\" ||exit 1; done; done
+	    test -z \"\`git diff refs/remotes/origin/\$i \
+	                         refs/remotes/origin/\$j\`\" ||exit 1; done; done
 	"
 
 test_expect_success 'migrate --minimize on old inited layout' '
@@ -98,27 +98,27 @@ test_expect_success 'migrate --minimize on old inited layout' '
 	git svn migrate --minimize &&
 	test -z "`git config -l | grep "^svn-remote\.git-svn\."`" &&
 	git config --get-all svn-remote.svn.fetch > fetch.out &&
-	grep "^trunk:refs/remotes/trunk$" fetch.out &&
-	grep "^branches/a:refs/remotes/a$" fetch.out &&
-	grep "^branches/b:refs/remotes/b$" fetch.out &&
-	grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
-	grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
-	grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out &&
+	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
+	grep "^branches/a:refs/remotes/origin/a$" fetch.out &&
+	grep "^branches/b:refs/remotes/origin/b$" fetch.out &&
+	grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
+	grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
+	grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
 	grep "^:refs/${remotes_git_svn}" fetch.out
 	'
 
 test_expect_success  ".rev_db auto-converted to .rev_map.UUID" '
 	git svn fetch -i trunk &&
-	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)" &&
-	expect="$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_map.*)" &&
+	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)" &&
+	expect="$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_map.*)" &&
 	test -n "$expect" &&
 	rev_db="$(echo $expect | sed -e "s,_map,_db,")" &&
 	convert_to_rev_db "$expect" "$rev_db" &&
 	rm -f "$expect" &&
 	test -f "$rev_db" &&
 	git svn fetch -i trunk &&
-	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)" &&
-	test ! -e "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db &&
+	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)" &&
+	test ! -e "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db &&
 	test -f "$expect"
 	'
 
diff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh
index f524d2f..6f0968a 100755
--- a/t/t9114-git-svn-dcommit-merge.sh
+++ b/t/t9114-git-svn-dcommit-merge.sh
@@ -48,7 +48,7 @@ test_expect_success 'setup svn repository' '
 test_expect_success 'setup git mirror and merge' '
 	git svn init "$svnrepo" -t tags -T trunk -b branches &&
 	git svn fetch &&
-	git checkout -b svn remotes/trunk &&
+	git checkout -b svn remotes/origin/trunk &&
 	git checkout -b merge &&
 	echo new file > new_file &&
 	git add new_file &&
@@ -81,7 +81,7 @@ test_debug 'gitk --all & sleep 1'
 
 test_expect_success 'verify post-merge ancestry' "
 	test x\`git rev-parse --verify refs/heads/svn\` = \
-	     x\`git rev-parse --verify refs/remotes/trunk \` &&
+	     x\`git rev-parse --verify refs/remotes/origin/trunk \` &&
 	test x\`git rev-parse --verify refs/heads/svn^2\` = \
 	     x\`git rev-parse --verify refs/heads/merge\` &&
 	git cat-file commit refs/heads/svn^ | grep '^friend$'
diff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh
index cf4c052..45773ee 100755
--- a/t/t9116-git-svn-log.sh
+++ b/t/t9116-git-svn-log.sh
@@ -20,20 +20,20 @@ test_expect_success 'setup repository and import' '
 	) &&
 	git svn init "$svnrepo" -T trunk -b branches -t tags &&
 	git svn fetch &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	echo bye >> README &&
 	git commit -a -m bye &&
 	git svn dcommit &&
-	git reset --hard a &&
+	git reset --hard origin/a &&
 	echo why >> FEEDME &&
 	git update-index --add FEEDME &&
 	git commit -m feedme &&
 	git svn dcommit &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	echo aye >> README &&
 	git commit -a -m aye &&
 	git svn dcommit &&
-	git reset --hard b &&
+	git reset --hard origin/b &&
 	echo spy >> README &&
 	git commit -a -m spy &&
 	echo try >> README &&
@@ -42,26 +42,26 @@ test_expect_success 'setup repository and import' '
 	'
 
 test_expect_success 'run log' "
-	git reset --hard a &&
-	git svn log -r2 trunk | grep ^r2 &&
-	git svn log -r4 trunk | grep ^r4 &&
+	git reset --hard origin/a &&
+	git svn log -r2 origin/trunk | grep ^r2 &&
+	git svn log -r4 origin/trunk | grep ^r4 &&
 	git svn log -r3 | grep ^r3
 	"
 
 test_expect_success 'run log against a from trunk' "
-	git reset --hard trunk &&
-	git svn log -r3 a | grep ^r3
+	git reset --hard origin/trunk &&
+	git svn log -r3 origin/a | grep ^r3
 	"
 
 printf 'r1 \nr2 \nr4 \n' > expected-range-r1-r2-r4
 
 test_expect_success 'test ascending revision range' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
 	"
 
 test_expect_success 'test ascending revision range with --show-commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
 	"
 
@@ -69,7 +69,7 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' "
 	git svn find-rev r1 >expected-range-r1-r2-r4-sha1 &&
 	git svn find-rev r2 >>expected-range-r1-r2-r4-sha1 &&
 	git svn find-rev r4 >>expected-range-r1-r2-r4-sha1 &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f2 >out &&
 	git rev-parse \$(cat out) >actual &&
 	test_cmp expected-range-r1-r2-r4-sha1 actual
@@ -78,67 +78,67 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' "
 printf 'r4 \nr2 \nr1 \n' > expected-range-r4-r2-r1
 
 test_expect_success 'test descending revision range' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 4:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4-r2-r1 -
 	"
 
 printf 'r1 \nr2 \n' > expected-range-r1-r2
 
 test_expect_success 'test ascending revision range with unreachable revision' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 1:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2 -
 	"
 
 printf 'r2 \nr1 \n' > expected-range-r2-r1
 
 test_expect_success 'test descending revision range with unreachable revision' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2-r1 -
 	"
 
 printf 'r2 \n' > expected-range-r2
 
 test_expect_success 'test ascending revision range with unreachable upper boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 2:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -
 	"
 
 test_expect_success 'test descending revision range with unreachable upper boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:2 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -
 	"
 
 printf 'r4 \n' > expected-range-r4
 
 test_expect_success 'test ascending revision range with unreachable lower boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
 test_expect_success 'test descending revision range with unreachable lower boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 4:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
 printf -- '------------------------------------------------------------------------\n' > expected-separator
 
 test_expect_success 'test ascending revision range with unreachable boundary revisions and no commits' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 5:6 | test_cmp expected-separator -
 	"
 
 test_expect_success 'test descending revision range with unreachable boundary revisions and no commits' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 6:5 | test_cmp expected-separator -
 	"
 
 test_expect_success 'test ascending revision range with unreachable boundary revisions and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:5 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
 test_expect_success 'test descending revision range with unreachable boundary revisions and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 5:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
diff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh
index 15f93b4..ed4d136 100755
--- a/t/t9118-git-svn-funky-branch-names.sh
+++ b/t/t9118-git-svn-funky-branch-names.sh
@@ -41,20 +41,20 @@ test_expect_success 'test clone with funky branch names' '
 	git svn clone -s "$svnrepo/pr ject" project &&
 	(
 		cd project &&
-		git rev-parse "refs/remotes/fun%20plugin" &&
-		git rev-parse "refs/remotes/more%20fun%20plugin!" &&
-		git rev-parse "refs/remotes/$scary_ref" &&
-		git rev-parse "refs/remotes/%2Eleading_dot" &&
-		git rev-parse "refs/remotes/trailing_dot%2E" &&
-		git rev-parse "refs/remotes/trailing_dotlock%2Elock" &&
-		git rev-parse "refs/remotes/$non_reflog"
+		git rev-parse "refs/remotes/origin/fun%20plugin" &&
+		git rev-parse "refs/remotes/origin/more%20fun%20plugin!" &&
+		git rev-parse "refs/remotes/origin/$scary_ref" &&
+		git rev-parse "refs/remotes/origin/%2Eleading_dot" &&
+		git rev-parse "refs/remotes/origin/trailing_dot%2E" &&
+		git rev-parse "refs/remotes/origin/trailing_dotlock%2Elock" &&
+		git rev-parse "refs/remotes/origin/$non_reflog"
 	)
 	'
 
 test_expect_success 'test dcommit to funky branch' "
 	(
 		cd project &&
-		git reset --hard 'refs/remotes/more%20fun%20plugin!' &&
+		git reset --hard 'refs/remotes/origin/more%20fun%20plugin!' &&
 		echo hello >> foo &&
 		git commit -m 'hello' -- foo &&
 		git svn dcommit
@@ -64,7 +64,7 @@ test_expect_success 'test dcommit to funky branch' "
 test_expect_success 'test dcommit to scary branch' '
 	(
 		cd project &&
-		git reset --hard "refs/remotes/$scary_ref" &&
+		git reset --hard "refs/remotes/origin/$scary_ref" &&
 		echo urls are scary >> foo &&
 		git commit -m "eep" -- foo &&
 		git svn dcommit
@@ -74,7 +74,7 @@ test_expect_success 'test dcommit to scary branch' '
 test_expect_success 'test dcommit to trailing_dotlock branch' '
 	(
 		cd project &&
-		git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
+		git reset --hard "refs/remotes/origin/trailing_dotlock%2Elock" &&
 		echo who names branches like this anyway? >> foo &&
 		git commit -m "bar" -- foo &&
 		git svn dcommit
diff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh
index 1d92c05..1c84ce1 100755
--- a/t/t9120-git-svn-clone-with-percent-escapes.sh
+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh
@@ -58,19 +58,19 @@ test_expect_success 'test clone --stdlayout with percent escapes' '
 	git svn clone --stdlayout "$svnrepo/pr%20ject" percent &&
 	(
 		cd percent &&
-		git rev-parse refs/remotes/trunk^0 &&
-		git rev-parse refs/remotes/b^0 &&
-		git rev-parse refs/remotes/tags/v1^0
+		git rev-parse refs/remotes/origin/trunk^0 &&
+		git rev-parse refs/remotes/origin/b^0 &&
+		git rev-parse refs/remotes/origin/tags/v1^0
 	)
 '
 
 test_expect_success 'test clone -s with unescaped space' '
-	git svn clone -s "$svnrepo/pr ject" space &&
+	git svn clone -s "$svnrepo/pr ject" --prefix origin/ space &&
 	(
 		cd space &&
-		git rev-parse refs/remotes/trunk^0 &&
-		git rev-parse refs/remotes/b^0 &&
-		git rev-parse refs/remotes/tags/v1^0
+		git rev-parse refs/remotes/origin/trunk^0 &&
+		git rev-parse refs/remotes/origin/b^0 &&
+		git rev-parse refs/remotes/origin/tags/v1^0
 	)
 '
 
diff --git a/t/t9125-git-svn-multi-glob-branch-names.sh b/t/t9125-git-svn-multi-glob-branch-names.sh
index 096abd1..0d53fc9 100755
--- a/t/t9125-git-svn-multi-glob-branch-names.sh
+++ b/t/t9125-git-svn-multi-glob-branch-names.sh
@@ -20,14 +20,14 @@ test_expect_success 'test clone with multi-glob in branch names' '
 	git svn clone -T trunk -b branches/*/* -t tags \
 	              "$svnrepo/project" project &&
 	(cd project &&
-		git rev-parse "refs/remotes/v14.1/beta" &&
-		git rev-parse "refs/remotes/v14.1/gold"
+		git rev-parse "refs/remotes/origin/v14.1/beta" &&
+		git rev-parse "refs/remotes/origin/v14.1/gold"
 	)
 	'
 
 test_expect_success 'test dcommit to multi-globbed branch' "
 	(cd project &&
-	git reset --hard 'refs/remotes/v14.1/gold' &&
+	git reset --hard 'refs/remotes/origin/v14.1/gold' &&
 	echo hello >> foo &&
 	git commit -m 'hello' -- foo &&
 	git svn dcommit
diff --git a/t/t9128-git-svn-cmd-branch.sh b/t/t9128-git-svn-cmd-branch.sh
index 4b034a6..4e95f79 100755
--- a/t/t9128-git-svn-cmd-branch.sh
+++ b/t/t9128-git-svn-cmd-branch.sh
@@ -29,30 +29,30 @@ test_expect_success 'initialize svnrepo' '
 test_expect_success 'import into git' '
 	git svn init --stdlayout "$svnrepo" &&
 	git svn fetch &&
-	git checkout remotes/trunk
+	git checkout remotes/origin/trunk
 '
 
 test_expect_success 'git svn branch tests' '
 	git svn branch a &&
 	base=$(git rev-parse HEAD:) &&
-	test $base = $(git rev-parse remotes/a:) &&
+	test $base = $(git rev-parse remotes/origin/a:) &&
 	git svn branch -m "created branch b blah" b &&
-	test $base = $(git rev-parse remotes/b:) &&
+	test $base = $(git rev-parse remotes/origin/b:) &&
 	test_must_fail git branch -m "no branchname" &&
 	git svn branch -n c &&
-	test_must_fail git rev-parse remotes/c &&
+	test_must_fail git rev-parse remotes/origin/c &&
 	test_must_fail git svn branch a &&
 	git svn branch -t tag1 &&
-	test $base = $(git rev-parse remotes/tags/tag1:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag1:) &&
 	git svn branch --tag tag2 &&
-	test $base = $(git rev-parse remotes/tags/tag2:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag2:) &&
 	git svn tag tag3 &&
-	test $base = $(git rev-parse remotes/tags/tag3:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag3:) &&
 	git svn tag -m "created tag4 foo" tag4 &&
-	test $base = $(git rev-parse remotes/tags/tag4:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag4:) &&
 	test_must_fail git svn tag -m "no tagname" &&
 	git svn tag -n tag5 &&
-	test_must_fail git rev-parse remotes/tags/tag5 &&
+	test_must_fail git rev-parse remotes/origin/tags/tag5 &&
 	test_must_fail git svn tag tag1
 '
 
diff --git a/t/t9135-git-svn-moved-branch-empty-file.sh b/t/t9135-git-svn-moved-branch-empty-file.sh
index 5280e5f..93db45d 100755
--- a/t/t9135-git-svn-moved-branch-empty-file.sh
+++ b/t/t9135-git-svn-moved-branch-empty-file.sh
@@ -12,7 +12,7 @@ test_expect_success 'clone using git svn' 'git svn clone -s "$svnrepo" x'
 test_expect_success 'test that b1 exists and is empty' '
 	(
 		cd x &&
-		git reset --hard branch-c &&
+		git reset --hard origin/branch-c &&
 		test -f b1 &&
 		! test -s b1
 	)
diff --git a/t/t9141-git-svn-multiple-branches.sh b/t/t9141-git-svn-multiple-branches.sh
index 3cd0671..8e7f7d6 100755
--- a/t/t9141-git-svn-multiple-branches.sh
+++ b/t/t9141-git-svn-multiple-branches.sh
@@ -66,18 +66,18 @@ test_expect_success 'clone multiple branch and tag paths' '
 		      -t tags_A/* --tags tags_B \
 		      "$svnrepo/project" git_project &&
 	( cd git_project &&
-		git rev-parse refs/remotes/first &&
-		git rev-parse refs/remotes/second &&
-		git rev-parse refs/remotes/1 &&
-		git rev-parse refs/remotes/2 &&
-		git rev-parse refs/remotes/tags/1.0 &&
-		git rev-parse refs/remotes/tags/2.0 &&
-		git rev-parse refs/remotes/tags/3.0 &&
-		git rev-parse refs/remotes/tags/4.0 &&
-		git rev-parse refs/remotes/tags/v5 &&
-		git rev-parse refs/remotes/tags/v6 &&
-		git rev-parse refs/remotes/tags/v7 &&
-		git rev-parse refs/remotes/tags/v8
+		git rev-parse refs/remotes/origin/first &&
+		git rev-parse refs/remotes/origin/second &&
+		git rev-parse refs/remotes/origin/1 &&
+		git rev-parse refs/remotes/origin/2 &&
+		git rev-parse refs/remotes/origin/tags/1.0 &&
+		git rev-parse refs/remotes/origin/tags/2.0 &&
+		git rev-parse refs/remotes/origin/tags/3.0 &&
+		git rev-parse refs/remotes/origin/tags/4.0 &&
+		git rev-parse refs/remotes/origin/tags/v5 &&
+		git rev-parse refs/remotes/origin/tags/v6 &&
+		git rev-parse refs/remotes/origin/tags/v7 &&
+		git rev-parse refs/remotes/origin/tags/v8
 	)
 '
 
@@ -85,8 +85,8 @@ test_expect_success 'Multiple branch or tag paths require -d' '
 	( cd git_project &&
 		test_must_fail git svn branch -m "No new branch" Nope &&
 		test_must_fail git svn tag -m "No new tag" Tagless &&
-		test_must_fail git rev-parse refs/remotes/Nope &&
-		test_must_fail git rev-parse refs/remotes/tags/Tagless
+		test_must_fail git rev-parse refs/remotes/origin/Nope &&
+		test_must_fail git rev-parse refs/remotes/origin/tags/Tagless
 	) &&
 	( cd svn_project &&
 		svn_cmd up &&
diff --git a/t/t9145-git-svn-master-branch.sh b/t/t9145-git-svn-master-branch.sh
index 16852d2..6559137 100755
--- a/t/t9145-git-svn-master-branch.sh
+++ b/t/t9145-git-svn-master-branch.sh
@@ -17,7 +17,7 @@ test_expect_success 'git svn clone --stdlayout sets up trunk as master' '
 	git svn clone -s "$svnrepo" g &&
 	(
 		cd g &&
-		test x`git rev-parse --verify refs/remotes/trunk^0` = \
+		test x`git rev-parse --verify refs/remotes/origin/trunk^0` = \
 		     x`git rev-parse --verify refs/heads/master^0`
 	)
 '
diff --git a/t/t9155-git-svn-fetch-deleted-tag.sh b/t/t9155-git-svn-fetch-deleted-tag.sh
index a486a98..184336f 100755
--- a/t/t9155-git-svn-fetch-deleted-tag.sh
+++ b/t/t9155-git-svn-fetch-deleted-tag.sh
@@ -35,8 +35,8 @@ test_expect_success 'fetch deleted tags from same revision with checksum error'
 	cd git_project &&
 	git svn fetch &&
 
-	git diff --exit-code mybranch:trunk/subdir/file tags/mytag:file &&
-	git diff --exit-code master:subdir/file tags/mytag^:file
+	git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
+	git diff --exit-code master:subdir/file origin/tags/mytag^:file
 '
 
 test_done
diff --git a/t/t9156-git-svn-fetch-deleted-tag-2.sh b/t/t9156-git-svn-fetch-deleted-tag-2.sh
index 5ce7e2f..7a6e33b 100755
--- a/t/t9156-git-svn-fetch-deleted-tag-2.sh
+++ b/t/t9156-git-svn-fetch-deleted-tag-2.sh
@@ -36,9 +36,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro
 	cd git_project &&
 	git svn fetch &&
 
-	git diff --exit-code master:subdir3/file tags/mytag:file &&
-	git diff --exit-code master:subdir2/file tags/mytag^:file &&
-	git diff --exit-code master:subdir1/file tags/mytag^^:file
+	git diff --exit-code master:subdir3/file origin/tags/mytag:file &&
+	git diff --exit-code master:subdir2/file origin/tags/mytag^:file &&
+	git diff --exit-code master:subdir1/file origin/tags/mytag^^:file
 '
 
 test_done
diff --git a/t/t9161-git-svn-mergeinfo-push.sh b/t/t9161-git-svn-mergeinfo-push.sh
index 1eab701..6cb0909 100755
--- a/t/t9161-git-svn-mergeinfo-push.sh
+++ b/t/t9161-git-svn-mergeinfo-push.sh
@@ -18,8 +18,8 @@ test_expect_success 'load svn dump' "
 
 test_expect_success 'propagate merge information' '
 	git config svn.pushmergeinfo yes &&
-	git checkout svnb1 &&
-	git merge --no-ff svnb2 &&
+	git checkout origin/svnb1 &&
+	git merge --no-ff origin/svnb2 &&
 	git svn dcommit
 	'
 
@@ -29,7 +29,7 @@ test_expect_success 'check svn:mergeinfo' '
 	'
 
 test_expect_success 'merge another branch' '
-	git merge --no-ff svnb3 &&
+	git merge --no-ff origin/svnb3 &&
 	git svn dcommit
 	'
 
@@ -40,7 +40,7 @@ test_expect_success 'check primary parent mergeinfo respected' '
 	'
 
 test_expect_success 'merge existing merge' '
-	git merge --no-ff svnb4 &&
+	git merge --no-ff origin/svnb4 &&
 	git svn dcommit
 	'
 
@@ -53,7 +53,7 @@ test_expect_success "check both parents' mergeinfo respected" '
 	'
 
 test_expect_success 'make further commits to branch' '
-	git checkout svnb2 &&
+	git checkout origin/svnb2 &&
 	touch newb2file &&
 	git add newb2file &&
 	git commit -m "later b2 commit" &&
@@ -64,8 +64,8 @@ test_expect_success 'make further commits to branch' '
 	'
 
 test_expect_success 'second forward merge' '
-	git checkout svnb1 &&
-	git merge --no-ff svnb2 &&
+	git checkout origin/svnb1 &&
+	git merge --no-ff origin/svnb2 &&
 	git svn dcommit
 	'
 
@@ -78,8 +78,8 @@ test_expect_success 'check new mergeinfo added' '
 	'
 
 test_expect_success 'reintegration merge' '
-	git checkout svnb4 &&
-	git merge --no-ff svnb1 &&
+	git checkout origin/svnb4 &&
+	git merge --no-ff origin/svnb1 &&
 	git svn dcommit
 	'
 
@@ -92,11 +92,11 @@ test_expect_success 'check reintegration mergeinfo' '
 	'
 
 test_expect_success 'dcommit a merge at the top of a stack' '
-	git checkout svnb1 &&
+	git checkout origin/svnb1 &&
 	touch anotherfile &&
 	git add anotherfile &&
 	git commit -m "a commit" &&
-	git merge svnb4 &&
+	git merge origin/svnb4 &&
 	git svn dcommit
 	'
 
diff --git a/t/t9163-git-svn-reset-clears-caches.sh b/t/t9163-git-svn-reset-clears-caches.sh
index cd4c662..d6245ce 100755
--- a/t/t9163-git-svn-reset-clears-caches.sh
+++ b/t/t9163-git-svn-reset-clears-caches.sh
@@ -70,9 +70,9 @@ test_expect_success 'rebase looses SVN merge (m)' '
 #
 test_expect_success 'reset and fetch gets the SVN merge (m) correctly' '
 	git svn reset -r 3 &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn fetch &&
-	test 2 = $(git cat-file -p trunk|grep parent|wc -l)
+	test 2 = $(git cat-file -p origin/trunk|grep parent|wc -l)
 '
 
 test_done
diff --git a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh
index 13ae7e3..fa3ef3b 100755
--- a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh
+++ b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh
@@ -53,7 +53,7 @@ test_expect_success 'clone svn repo' '
 '
 
 test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&
-	y=$(git rev-parse branch2) &&
+	y=$(git rev-parse origin/branch2) &&
 	test "x$x" = "x$y"
 '
 
diff --git a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh
index af0ec0e..52f2e46 100755
--- a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh
+++ b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh
@@ -46,7 +46,7 @@ test_expect_success 'clone svn repo' '
 '
 
 test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&
-	y=$(git rev-parse branch2) &&
+	y=$(git rev-parse origin/branch2) &&
 	test "x$x" = "x$y"
 '
 
diff --git a/t/t9167-git-svn-cmd-branch-subproject.sh b/t/t9167-git-svn-cmd-branch-subproject.sh
index 53def87..ba35fc0 100755
--- a/t/t9167-git-svn-cmd-branch-subproject.sh
+++ b/t/t9167-git-svn-cmd-branch-subproject.sh
@@ -31,7 +31,7 @@ test_expect_success 'import into git' '
 	git svn init --trunk=trunk/project --branches=branches/*/project \
 		--tags=tags/*/project "$svnrepo" &&
 	git svn fetch &&
-	git checkout remotes/trunk
+	git checkout remotes/origin/trunk
 '
 
 test_expect_success 'git svn branch tests' '
-- 
1.8.4.653.g2df02b3

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [RFC/PATCH] git svn: Set default --prefix='origin/' if --prefix is not given
  2013-09-30 22:46   ` [RFC/PATCH] git svn: Set default --prefix='origin/' if --prefix is not given Johan Herland
@ 2013-10-01  4:07     ` Eric Wong
  2013-10-01  6:12       ` Johan Herland
  0 siblings, 1 reply; 23+ messages in thread
From: Eric Wong @ 2013-10-01  4:07 UTC (permalink / raw)
  To: Johan Herland; +Cc: git, tfnico

Johan Herland <johan@herland.net> wrote:
> 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.

I regretted my original naming shortly after introducing it (IIRC,
git-svn was the first refs/remotes/* user).  However, this risks
breaking existing code and 3rd-party docs/tutorials.

How about we put a big warning of impending change in there for now and
wait until git 1.9/2.0 to make the actual change?

Thanks for bringing this up again!

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [RFC/PATCH] git svn: Set default --prefix='origin/' if --prefix is not given
  2013-10-01  4:07     ` Eric Wong
@ 2013-10-01  6:12       ` Johan Herland
  2013-10-03 19:01         ` Eric Wong
  0 siblings, 1 reply; 23+ messages in thread
From: Johan Herland @ 2013-10-01  6:12 UTC (permalink / raw)
  To: Eric Wong; +Cc: Git mailing list, Thomas Ferris Nicolaisen

On Tue, Oct 1, 2013 at 6:07 AM, Eric Wong <normalperson@yhbt.net> wrote:
> Johan Herland <johan@herland.net> wrote:
>> 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.
>
> I regretted my original naming shortly after introducing it (IIRC,
> git-svn was the first refs/remotes/* user).  However, this risks
> breaking existing code and 3rd-party docs/tutorials.

True. Although the patch does not affect existing git-svn
configurations, it does affect all future (where the user does not
pass --prefix), and all documentation and scripts that will come to
work on those must be adjusted accordingly.

> How about we put a big warning of impending change in there for now and
> wait until git 1.9/2.0 to make the actual change?

Sounds sensible. What should the warning look like, and where should
it be placed? I'm thinking that if you run git svn init/clone without
--prefix, there should be a verbose warning explaining (a) the trouble
you're likely to encounter when using no prefix, and (b) the upcoming
change in default prefix. Obviuosly, there should be a corresponding
note in the git-svn manual page. Any other places in git.git that
warrants changing? Hopefully this should be sufficient to trigger
corresponding adjustments in third-party tools + docs ahead of the
actual change in 1.9/2.0.

> Thanks for bringing this up again!

Thanks for your comments!


...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [RFC/PATCH] git svn: Set default --prefix='origin/' if --prefix is not given
  2013-10-01  6:12       ` Johan Herland
@ 2013-10-03 19:01         ` Eric Wong
  2013-10-05 23:30           ` [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Johan Herland
  0 siblings, 1 reply; 23+ messages in thread
From: Eric Wong @ 2013-10-03 19:01 UTC (permalink / raw)
  To: Johan Herland; +Cc: Git mailing list, Thomas Ferris Nicolaisen

Johan Herland <johan@herland.net> wrote:
> On Tue, Oct 1, 2013 at 6:07 AM, Eric Wong <normalperson@yhbt.net> wrote:
> > How about we put a big warning of impending change in there for now and
> > wait until git 1.9/2.0 to make the actual change?
> 
> Sounds sensible. What should the warning look like, and where should
> it be placed? I'm thinking that if you run git svn init/clone without
> --prefix, there should be a verbose warning explaining (a) the trouble
> you're likely to encounter when using no prefix, and (b) the upcoming
> change in default prefix. Obviuosly, there should be a corresponding
> note in the git-svn manual page. Any other places in git.git that
> warrants changing? Hopefully this should be sufficient to trigger
> corresponding adjustments in third-party tools + docs ahead of the
> actual change in 1.9/2.0.

Probably, yes.  I don't remember off the top of my head if there's
other places, but init/clone should be a good enough start.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples
  2013-10-03 19:01         ` Eric Wong
@ 2013-10-05 23:30           ` Johan Herland
  2013-10-05 23:30             ` [RFC/PATCHv2 2/3] git-svn: Warn about changing default for --prefix in Git v2.0 Johan Herland
                               ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Johan Herland @ 2013-10-05 23:30 UTC (permalink / raw)
  To: git; +Cc: tfnico, Johan Herland, Eric Wong

Currently, the git-svn defaults to using an empty prefix, which ends
up placing the SVN-tracking refs directly in refs/remotes/*. This
placement runs counter to Git's convention of placing remote-tracking
branches in refs/remotes/$remote/*.

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.

At this time, the user is better off using the --prefix=foo/ (the
trailing slash is important) to git svn init/clone, to cause the
SVN-tracking refs to be placed at refs/remotes/foo/* instead of
refs/remotes/*. This patch updates the documentation to encourage
use of --prefix.

This is also in preparation for changing the default value of --prefix
at some point in the future.

Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
---
 Documentation/git-svn.txt | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 4dd3bcb..da00671 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -79,8 +79,13 @@ COMMANDS
 	trailing slash, so be sure you include one in the
 	argument if that is what you want.  If --branches/-b is
 	specified, the prefix must include a trailing slash.
-	Setting a prefix is useful if you wish to track multiple
-	projects that share a common repository.
+	Setting a prefix (with a trailing slash) is strongly
+	encouraged in any case, as your SVN-tracking refs will
+	then be located at "refs/remotes/$prefix/*", which is
+	compatible with Git's own remote-tracking ref layout
+	(refs/remotes/$remote/*). Setting a prefix is also useful
+	if you wish to track multiple projects that share a common
+	repository.
 --ignore-paths=<regex>;;
 	When passed to 'init' or 'clone' this regular expression will
 	be preserved as a config key.  See 'fetch' for a description
@@ -804,16 +809,16 @@ Tracking and contributing to an entire Subversion-managed project
 
 ------------------------------------------------------------------------
 # Clone a repo with standard SVN directory layout (like git clone):
-	git svn clone http://svn.example.com/project --stdlayout
+	git svn clone http://svn.example.com/project --stdlayout --prefix svn/
 # Or, if the repo uses a non-standard directory layout:
-	git svn clone http://svn.example.com/project -T tr -b branch -t tag
+	git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/
 # View all branches and tags you have cloned:
 	git branch -r
 # Create a new branch in SVN
     git svn branch waldo
 # Reset your master to trunk (or any other branch, replacing 'trunk'
 # with the appropriate name):
-	git reset --hard remotes/trunk
+	git reset --hard svn/trunk
 # You may only dcommit to one branch/tag/trunk at a time.  The usage
 # of dcommit/rebase/show-ignore should be the same as above.
 ------------------------------------------------------------------------
@@ -827,7 +832,7 @@ have each person clone that repository with 'git clone':
 
 ------------------------------------------------------------------------
 # Do the initial import on a server
-	ssh server "cd /pub && git svn clone http://svn.example.com/project
+	ssh server "cd /pub && git svn clone http://svn.example.com/project [options...]"
 # Clone locally - make sure the refs/remotes/ space matches the server
 	mkdir project
 	cd project
@@ -840,8 +845,9 @@ have each person clone that repository with 'git clone':
 	git config --remove-section remote.origin
 # Create a local branch from one of the branches just fetched
 	git checkout -b master FETCH_HEAD
-# Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
-	git svn init http://svn.example.com/project
+# Initialize 'git svn' locally (be sure to use the same URL and
+# --stdlayout/-T/-b/-t/--prefix options as were used on server)
+	git svn init http://svn.example.com/project [options...]
 # Pull the latest changes from Subversion
 	git svn rebase
 ------------------------------------------------------------------------
@@ -973,6 +979,15 @@ without giving any repository layout options.  If the full history with
 branches and tags is required, the options '--trunk' / '--branches' /
 '--tags' must be used.
 
+When using the options for describing the repository layout (--trunk,
+--tags, --branches, --stdlayout), please also specify the --prefix
+option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be
+placed at refs/remotes/origin/* rather than the default refs/remotes/*.
+The former is more compatible with the layout of Git's "regular"
+remote-tracking refs (refs/remotes/$remote/*), and may potentially
+prevent similarly named SVN branches and Git remotes from clobbering
+eachother.
+
 When using multiple --branches or --tags, 'git svn' does not automatically
 handle name collisions (for example, if two branches from different paths have
 the same name, or if a branch and a tag have the same name).  In these cases,
@@ -1035,8 +1050,8 @@ comma-separated list of names within braces. For example:
 [svn-remote "huge-project"]
 	url = http://server.org/svn
 	fetch = trunk/src:refs/remotes/trunk
-	branches = branches/{red,green}/src:refs/remotes/branches/*
-	tags = tags/{1.0,2.0}/src:refs/remotes/tags/*
+	branches = branches/{red,green}/src:refs/remotes/project-a/branches/*
+	tags = tags/{1.0,2.0}/src:refs/remotes/project-a/tags/*
 ------------------------------------------------------------------------
 
 Multiple fetch, branches, and tags keys are supported:
-- 
1.8.4.653.g2df02b3

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [RFC/PATCHv2 2/3] git-svn: Warn about changing default for --prefix in Git v2.0
  2013-10-05 23:30           ` [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Johan Herland
@ 2013-10-05 23:30             ` Johan Herland
  2013-10-09  1:34               ` Eric Sunshine
  2013-10-05 23:30             ` [RFC/PATCHv2 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given Johan Herland
                               ` (3 subsequent siblings)
  4 siblings, 1 reply; 23+ messages in thread
From: Johan Herland @ 2013-10-05 23:30 UTC (permalink / raw)
  To: git; +Cc: tfnico, Johan Herland, Eric Wong

In Git v2.0, we will change the default --prefix for init/clone from
none/empty to "origin/" (which causes SVN-tracking branches to be
placed at refs/remotes/origin/* instead of refs/remotes/*).

This patch warns users about the upcoming change, both in the git-svn
manual page, and on stderr when running init/clone in the "multi-mode"
without providing a --prefix.

Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
---
 Documentation/git-svn.txt     | 11 ++++++-
 git-svn.perl                  | 12 +++++++-
 t/t9117-git-svn-init-clone.sh | 67 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index da00671..59e912e 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -86,6 +86,14 @@ COMMANDS
 	(refs/remotes/$remote/*). Setting a prefix is also useful
 	if you wish to track multiple projects that share a common
 	repository.
++
+NOTE: In Git v2.0, the default prefix will CHANGE from "" (no prefix)
+to "origin/". This is done to put SVN-tracking refs at
+"refs/remotes/origin/*" instead of "refs/remotes/*", and make them
+more compatible with how Git's own remote-tracking refs are organized
+(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,
+by using the --prefix option.
+
 --ignore-paths=<regex>;;
 	When passed to 'init' or 'clone' this regular expression will
 	be preserved as a config key.  See 'fetch' for a description
@@ -986,7 +994,8 @@ placed at refs/remotes/origin/* rather than the default refs/remotes/*.
 The former is more compatible with the layout of Git's "regular"
 remote-tracking refs (refs/remotes/$remote/*), and may potentially
 prevent similarly named SVN branches and Git remotes from clobbering
-eachother.
+eachother. In Git v2.0 the default prefix used (i.e. when no --prefix
+is given) will change from "" (no prefix) to "origin/".
 
 When using multiple --branches or --tags, 'git svn' does not automatically
 handle name collisions (for example, if two branches from different paths have
diff --git a/git-svn.perl b/git-svn.perl
index ff1ce3d..0443a4f 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1389,7 +1389,17 @@ sub cmd_multi_init {
 		usage(1);
 	}
 
-	$_prefix = '' unless defined $_prefix;
+	unless (defined $_prefix) {
+		$_prefix = '';
+		warn <<EOF
+WARNING: --prefix is not given, defaulting to empty prefix.
+         This is probably not what you want! In order to stay compatible
+         with regular remote-tracking refs, provide a prefix like
+         --prefix=origin/ (remember the trailing slash), which will cause
+         the SVN-tracking refs to be placed at refs/remotes/origin/*.
+NOTE: In Git v2.0, the default prefix will change from empty to 'origin/'.
+EOF
+	}
 	if (defined $url) {
 		$url = canonicalize_url($url);
 		init_subdir(@_);
diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh
index b7ef9e2..1c8d049 100755
--- a/t/t9117-git-svn-init-clone.sh
+++ b/t/t9117-git-svn-init-clone.sh
@@ -52,4 +52,71 @@ test_expect_success 'clone to target directory with --stdlayout' '
 	rm -rf target
 	'
 
+test_expect_success 'init without -s/-T/-b/-t does not warn' '
+	test ! -d trunk &&
+	git svn init "$svnrepo"/project/trunk trunk 2>warning &&
+	test_must_fail grep -q prefix warning &&
+	rm -rf trunk &&
+	rm -f warning
+	'
+
+test_expect_success 'clone without -s/-T/-b/-t does not warn' '
+	test ! -d trunk &&
+	git svn clone "$svnrepo"/project/trunk 2>warning &&
+	test_must_fail grep -q prefix warning &&
+	rm -rf trunk &&
+	rm -f warning
+	'
+
+test_svn_configured_prefix () {
+	prefix=$1
+	cat >expect <<EOF
+project/trunk:refs/remotes/${prefix}trunk
+project/branches/*:refs/remotes/${prefix}*
+project/tags/*:refs/remotes/${prefix}tags/*
+EOF
+	test ! -f actual &&
+	git --git-dir=project/.git config svn-remote.svn.fetch >>actual &&
+	git --git-dir=project/.git config svn-remote.svn.branches >>actual &&
+	git --git-dir=project/.git config svn-remote.svn.tags >>actual &&
+	test_cmp expect actual &&
+	rm -f expect actual
+}
+
+test_expect_success 'init with -s/-T/-b/-t without --prefix warns' '
+	test ! -d project &&
+	git svn init -s "$svnrepo"/project project 2>warning &&
+	grep -q prefix warning &&
+	test_svn_configured_prefix "" &&
+	rm -rf project &&
+	rm -f warning
+	'
+
+test_expect_success 'clone with -s/-T/-b/-t without --prefix warns' '
+	test ! -d project &&
+	git svn clone -s "$svnrepo"/project 2>warning &&
+	grep -q prefix warning &&
+	test_svn_configured_prefix "" &&
+	rm -rf project &&
+	rm -f warning
+	'
+
+test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '
+	test ! -d project &&
+	git svn init -s "$svnrepo"/project project --prefix="" 2>warning &&
+	test_must_fail grep -q prefix warning &&
+	test_svn_configured_prefix "" &&
+	rm -rf project &&
+	rm -f warning
+	'
+
+test_expect_success 'clone with -s/-T/-b/-t and --prefix does not warn' '
+	test ! -d project &&
+	git svn clone -s "$svnrepo"/project --prefix="" 2>warning &&
+	test_must_fail grep -q prefix warning &&
+	test_svn_configured_prefix "" &&
+	rm -rf project &&
+	rm -f warning
+	'
+
 test_done
-- 
1.8.4.653.g2df02b3

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [RFC/PATCHv2 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given
  2013-10-05 23:30           ` [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Johan Herland
  2013-10-05 23:30             ` [RFC/PATCHv2 2/3] git-svn: Warn about changing default for --prefix in Git v2.0 Johan Herland
@ 2013-10-05 23:30             ` Johan Herland
  2013-10-06  9:51             ` [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Philip Oakley
                               ` (2 subsequent siblings)
  4 siblings, 0 replies; 23+ messages in thread
From: Johan Herland @ 2013-10-05 23:30 UTC (permalink / raw)
  To: git; +Cc: tfnico, Johan Herland, Eric Wong

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.)

Suggested-by: Thomas Ferris Nicolaisen <tfnico@gmail.com>
Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
---
 Documentation/git-svn.txt                        | 19 +--------
 git-svn.perl                                     | 12 +-----
 t/t9107-git-svn-migrate.sh                       | 54 ++++++++++++------------
 t/t9114-git-svn-dcommit-merge.sh                 |  4 +-
 t/t9116-git-svn-log.sh                           | 46 ++++++++++----------
 t/t9117-git-svn-init-clone.sh                    | 16 +++----
 t/t9118-git-svn-funky-branch-names.sh            | 20 ++++-----
 t/t9120-git-svn-clone-with-percent-escapes.sh    | 14 +++---
 t/t9125-git-svn-multi-glob-branch-names.sh       |  6 +--
 t/t9128-git-svn-cmd-branch.sh                    | 18 ++++----
 t/t9135-git-svn-moved-branch-empty-file.sh       |  2 +-
 t/t9141-git-svn-multiple-branches.sh             | 28 ++++++------
 t/t9145-git-svn-master-branch.sh                 |  2 +-
 t/t9155-git-svn-fetch-deleted-tag.sh             |  4 +-
 t/t9156-git-svn-fetch-deleted-tag-2.sh           |  6 +--
 t/t9161-git-svn-mergeinfo-push.sh                | 22 +++++-----
 t/t9163-git-svn-reset-clears-caches.sh           |  4 +-
 t/t9165-git-svn-fetch-merge-branch-of-branch.sh  |  2 +-
 t/t9166-git-svn-fetch-merge-branch-of-branch2.sh |  2 +-
 t/t9167-git-svn-cmd-branch-subproject.sh         |  2 +-
 20 files changed, 128 insertions(+), 155 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 59e912e..43da05a 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -86,14 +86,7 @@ COMMANDS
 	(refs/remotes/$remote/*). Setting a prefix is also useful
 	if you wish to track multiple projects that share a common
 	repository.
-+
-NOTE: In Git v2.0, the default prefix will CHANGE from "" (no prefix)
-to "origin/". This is done to put SVN-tracking refs at
-"refs/remotes/origin/*" instead of "refs/remotes/*", and make them
-more compatible with how Git's own remote-tracking refs are organized
-(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,
-by using the --prefix option.
-
+	By default, the prefix is set to 'origin/'.
 --ignore-paths=<regex>;;
 	When passed to 'init' or 'clone' this regular expression will
 	be preserved as a config key.  See 'fetch' for a description
@@ -987,16 +980,6 @@ without giving any repository layout options.  If the full history with
 branches and tags is required, the options '--trunk' / '--branches' /
 '--tags' must be used.
 
-When using the options for describing the repository layout (--trunk,
---tags, --branches, --stdlayout), please also specify the --prefix
-option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be
-placed at refs/remotes/origin/* rather than the default refs/remotes/*.
-The former is more compatible with the layout of Git's "regular"
-remote-tracking refs (refs/remotes/$remote/*), and may potentially
-prevent similarly named SVN branches and Git remotes from clobbering
-eachother. In Git v2.0 the default prefix used (i.e. when no --prefix
-is given) will change from "" (no prefix) to "origin/".
-
 When using multiple --branches or --tags, 'git svn' does not automatically
 handle name collisions (for example, if two branches from different paths have
 the same name, or if a branch and a tag have the same name).  In these cases,
diff --git a/git-svn.perl b/git-svn.perl
index 0443a4f..ad3fe66 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1389,17 +1389,7 @@ sub cmd_multi_init {
 		usage(1);
 	}
 
-	unless (defined $_prefix) {
-		$_prefix = '';
-		warn <<EOF
-WARNING: --prefix is not given, defaulting to empty prefix.
-         This is probably not what you want! In order to stay compatible
-         with regular remote-tracking refs, provide a prefix like
-         --prefix=origin/ (remember the trailing slash), which will cause
-         the SVN-tracking refs to be placed at refs/remotes/origin/*.
-NOTE: In Git v2.0, the default prefix will change from empty to 'origin/'.
-EOF
-	}
+	$_prefix = 'origin/' unless defined $_prefix;
 	if (defined $url) {
 		$url = canonicalize_url($url);
 		init_subdir(@_);
diff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh
index ee73013..6e69fc4 100755
--- a/t/t9107-git-svn-migrate.sh
+++ b/t/t9107-git-svn-migrate.sh
@@ -45,27 +45,27 @@ test_expect_success 'initialize old-style (v0) git svn layout' '
 test_expect_success 'initialize a multi-repository repo' '
 	git svn init "$svnrepo" -T trunk -t tags -b branches &&
 	git config --get-all svn-remote.svn.fetch > fetch.out &&
-	grep "^trunk:refs/remotes/trunk$" fetch.out &&
+	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
 	test -n "`git config --get svn-remote.svn.branches \
-	            "^branches/\*:refs/remotes/\*$"`" &&
+	            "^branches/\*:refs/remotes/origin/\*$"`" &&
 	test -n "`git config --get svn-remote.svn.tags \
-	            "^tags/\*:refs/remotes/tags/\*$"`" &&
+	            "^tags/\*:refs/remotes/origin/tags/\*$"`" &&
 	git config --unset svn-remote.svn.branches \
-	                        "^branches/\*:refs/remotes/\*$" &&
+	                        "^branches/\*:refs/remotes/origin/\*$" &&
 	git config --unset svn-remote.svn.tags \
-	                        "^tags/\*:refs/remotes/tags/\*$" &&
-	git config --add svn-remote.svn.fetch "branches/a:refs/remotes/a" &&
-	git config --add svn-remote.svn.fetch "branches/b:refs/remotes/b" &&
+	                        "^tags/\*:refs/remotes/origin/tags/\*$" &&
+	git config --add svn-remote.svn.fetch "branches/a:refs/remotes/origin/a" &&
+	git config --add svn-remote.svn.fetch "branches/b:refs/remotes/origin/b" &&
 	for i in tags/0.1 tags/0.2 tags/0.3; do
 		git config --add svn-remote.svn.fetch \
-		                 $i:refs/remotes/$i || exit 1; done &&
+		                 $i:refs/remotes/origin/$i || exit 1; done &&
 	git config --get-all svn-remote.svn.fetch > fetch.out &&
-	grep "^trunk:refs/remotes/trunk$" fetch.out &&
-	grep "^branches/a:refs/remotes/a$" fetch.out &&
-	grep "^branches/b:refs/remotes/b$" fetch.out &&
-	grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
-	grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
-	grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out &&
+	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
+	grep "^branches/a:refs/remotes/origin/a$" fetch.out &&
+	grep "^branches/b:refs/remotes/origin/b$" fetch.out &&
+	grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
+	grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
+	grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
 	grep "^:refs/${remotes_git_svn}" fetch.out
 	'
 
@@ -73,14 +73,14 @@ test_expect_success 'initialize a multi-repository repo' '
 test_expect_success 'multi-fetch works on partial urls + paths' "
 	git svn multi-fetch &&
 	for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
-		git rev-parse --verify refs/remotes/\$i^0 >> refs.out || exit 1;
+		git rev-parse --verify refs/remotes/origin/\$i^0 >> refs.out || exit 1;
 	    done &&
 	test -z \"\`sort < refs.out | uniq -d\`\" &&
 	for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
 	  for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do
 		if test \$j != \$i; then continue; fi
-	    test -z \"\`git diff refs/remotes/\$i \
-	                         refs/remotes/\$j\`\" ||exit 1; done; done
+	    test -z \"\`git diff refs/remotes/origin/\$i \
+	                         refs/remotes/origin/\$j\`\" ||exit 1; done; done
 	"
 
 test_expect_success 'migrate --minimize on old inited layout' '
@@ -98,27 +98,27 @@ test_expect_success 'migrate --minimize on old inited layout' '
 	git svn migrate --minimize &&
 	test -z "`git config -l | grep "^svn-remote\.git-svn\."`" &&
 	git config --get-all svn-remote.svn.fetch > fetch.out &&
-	grep "^trunk:refs/remotes/trunk$" fetch.out &&
-	grep "^branches/a:refs/remotes/a$" fetch.out &&
-	grep "^branches/b:refs/remotes/b$" fetch.out &&
-	grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
-	grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
-	grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out &&
+	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
+	grep "^branches/a:refs/remotes/origin/a$" fetch.out &&
+	grep "^branches/b:refs/remotes/origin/b$" fetch.out &&
+	grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
+	grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
+	grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
 	grep "^:refs/${remotes_git_svn}" fetch.out
 	'
 
 test_expect_success  ".rev_db auto-converted to .rev_map.UUID" '
 	git svn fetch -i trunk &&
-	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)" &&
-	expect="$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_map.*)" &&
+	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)" &&
+	expect="$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_map.*)" &&
 	test -n "$expect" &&
 	rev_db="$(echo $expect | sed -e "s,_map,_db,")" &&
 	convert_to_rev_db "$expect" "$rev_db" &&
 	rm -f "$expect" &&
 	test -f "$rev_db" &&
 	git svn fetch -i trunk &&
-	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)" &&
-	test ! -e "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db &&
+	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)" &&
+	test ! -e "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db &&
 	test -f "$expect"
 	'
 
diff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh
index f524d2f..6f0968a 100755
--- a/t/t9114-git-svn-dcommit-merge.sh
+++ b/t/t9114-git-svn-dcommit-merge.sh
@@ -48,7 +48,7 @@ test_expect_success 'setup svn repository' '
 test_expect_success 'setup git mirror and merge' '
 	git svn init "$svnrepo" -t tags -T trunk -b branches &&
 	git svn fetch &&
-	git checkout -b svn remotes/trunk &&
+	git checkout -b svn remotes/origin/trunk &&
 	git checkout -b merge &&
 	echo new file > new_file &&
 	git add new_file &&
@@ -81,7 +81,7 @@ test_debug 'gitk --all & sleep 1'
 
 test_expect_success 'verify post-merge ancestry' "
 	test x\`git rev-parse --verify refs/heads/svn\` = \
-	     x\`git rev-parse --verify refs/remotes/trunk \` &&
+	     x\`git rev-parse --verify refs/remotes/origin/trunk \` &&
 	test x\`git rev-parse --verify refs/heads/svn^2\` = \
 	     x\`git rev-parse --verify refs/heads/merge\` &&
 	git cat-file commit refs/heads/svn^ | grep '^friend$'
diff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh
index cf4c052..45773ee 100755
--- a/t/t9116-git-svn-log.sh
+++ b/t/t9116-git-svn-log.sh
@@ -20,20 +20,20 @@ test_expect_success 'setup repository and import' '
 	) &&
 	git svn init "$svnrepo" -T trunk -b branches -t tags &&
 	git svn fetch &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	echo bye >> README &&
 	git commit -a -m bye &&
 	git svn dcommit &&
-	git reset --hard a &&
+	git reset --hard origin/a &&
 	echo why >> FEEDME &&
 	git update-index --add FEEDME &&
 	git commit -m feedme &&
 	git svn dcommit &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	echo aye >> README &&
 	git commit -a -m aye &&
 	git svn dcommit &&
-	git reset --hard b &&
+	git reset --hard origin/b &&
 	echo spy >> README &&
 	git commit -a -m spy &&
 	echo try >> README &&
@@ -42,26 +42,26 @@ test_expect_success 'setup repository and import' '
 	'
 
 test_expect_success 'run log' "
-	git reset --hard a &&
-	git svn log -r2 trunk | grep ^r2 &&
-	git svn log -r4 trunk | grep ^r4 &&
+	git reset --hard origin/a &&
+	git svn log -r2 origin/trunk | grep ^r2 &&
+	git svn log -r4 origin/trunk | grep ^r4 &&
 	git svn log -r3 | grep ^r3
 	"
 
 test_expect_success 'run log against a from trunk' "
-	git reset --hard trunk &&
-	git svn log -r3 a | grep ^r3
+	git reset --hard origin/trunk &&
+	git svn log -r3 origin/a | grep ^r3
 	"
 
 printf 'r1 \nr2 \nr4 \n' > expected-range-r1-r2-r4
 
 test_expect_success 'test ascending revision range' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
 	"
 
 test_expect_success 'test ascending revision range with --show-commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
 	"
 
@@ -69,7 +69,7 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' "
 	git svn find-rev r1 >expected-range-r1-r2-r4-sha1 &&
 	git svn find-rev r2 >>expected-range-r1-r2-r4-sha1 &&
 	git svn find-rev r4 >>expected-range-r1-r2-r4-sha1 &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f2 >out &&
 	git rev-parse \$(cat out) >actual &&
 	test_cmp expected-range-r1-r2-r4-sha1 actual
@@ -78,67 +78,67 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' "
 printf 'r4 \nr2 \nr1 \n' > expected-range-r4-r2-r1
 
 test_expect_success 'test descending revision range' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 4:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4-r2-r1 -
 	"
 
 printf 'r1 \nr2 \n' > expected-range-r1-r2
 
 test_expect_success 'test ascending revision range with unreachable revision' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 1:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2 -
 	"
 
 printf 'r2 \nr1 \n' > expected-range-r2-r1
 
 test_expect_success 'test descending revision range with unreachable revision' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2-r1 -
 	"
 
 printf 'r2 \n' > expected-range-r2
 
 test_expect_success 'test ascending revision range with unreachable upper boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 2:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -
 	"
 
 test_expect_success 'test descending revision range with unreachable upper boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:2 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -
 	"
 
 printf 'r4 \n' > expected-range-r4
 
 test_expect_success 'test ascending revision range with unreachable lower boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
 test_expect_success 'test descending revision range with unreachable lower boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 4:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
 printf -- '------------------------------------------------------------------------\n' > expected-separator
 
 test_expect_success 'test ascending revision range with unreachable boundary revisions and no commits' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 5:6 | test_cmp expected-separator -
 	"
 
 test_expect_success 'test descending revision range with unreachable boundary revisions and no commits' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 6:5 | test_cmp expected-separator -
 	"
 
 test_expect_success 'test ascending revision range with unreachable boundary revisions and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:5 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
 test_expect_success 'test descending revision range with unreachable boundary revisions and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 5:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh
index 1c8d049..bea6145 100755
--- a/t/t9117-git-svn-init-clone.sh
+++ b/t/t9117-git-svn-init-clone.sh
@@ -83,25 +83,25 @@ EOF
 	rm -f expect actual
 }
 
-test_expect_success 'init with -s/-T/-b/-t without --prefix warns' '
+test_expect_success 'init with -s/-T/-b/-t assumes --prefix=origin/' '
 	test ! -d project &&
 	git svn init -s "$svnrepo"/project project 2>warning &&
-	grep -q prefix warning &&
-	test_svn_configured_prefix "" &&
+	test_must_fail grep -q prefix warning &&
+	test_svn_configured_prefix "origin/" &&
 	rm -rf project &&
 	rm -f warning
 	'
 
-test_expect_success 'clone with -s/-T/-b/-t without --prefix warns' '
+test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' '
 	test ! -d project &&
 	git svn clone -s "$svnrepo"/project 2>warning &&
-	grep -q prefix warning &&
-	test_svn_configured_prefix "" &&
+	test_must_fail grep -q prefix warning &&
+	test_svn_configured_prefix "origin/" &&
 	rm -rf project &&
 	rm -f warning
 	'
 
-test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '
+test_expect_success 'init with -s/-T/-b/-t and --prefix="" still works' '
 	test ! -d project &&
 	git svn init -s "$svnrepo"/project project --prefix="" 2>warning &&
 	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' '
 	rm -f warning
 	'
 
-test_expect_success 'clone with -s/-T/-b/-t and --prefix does not warn' '
+test_expect_success 'clone with -s/-T/-b/-t and --prefix="" still works' '
 	test ! -d project &&
 	git svn clone -s "$svnrepo"/project --prefix="" 2>warning &&
 	test_must_fail grep -q prefix warning &&
diff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh
index 15f93b4..ed4d136 100755
--- a/t/t9118-git-svn-funky-branch-names.sh
+++ b/t/t9118-git-svn-funky-branch-names.sh
@@ -41,20 +41,20 @@ test_expect_success 'test clone with funky branch names' '
 	git svn clone -s "$svnrepo/pr ject" project &&
 	(
 		cd project &&
-		git rev-parse "refs/remotes/fun%20plugin" &&
-		git rev-parse "refs/remotes/more%20fun%20plugin!" &&
-		git rev-parse "refs/remotes/$scary_ref" &&
-		git rev-parse "refs/remotes/%2Eleading_dot" &&
-		git rev-parse "refs/remotes/trailing_dot%2E" &&
-		git rev-parse "refs/remotes/trailing_dotlock%2Elock" &&
-		git rev-parse "refs/remotes/$non_reflog"
+		git rev-parse "refs/remotes/origin/fun%20plugin" &&
+		git rev-parse "refs/remotes/origin/more%20fun%20plugin!" &&
+		git rev-parse "refs/remotes/origin/$scary_ref" &&
+		git rev-parse "refs/remotes/origin/%2Eleading_dot" &&
+		git rev-parse "refs/remotes/origin/trailing_dot%2E" &&
+		git rev-parse "refs/remotes/origin/trailing_dotlock%2Elock" &&
+		git rev-parse "refs/remotes/origin/$non_reflog"
 	)
 	'
 
 test_expect_success 'test dcommit to funky branch' "
 	(
 		cd project &&
-		git reset --hard 'refs/remotes/more%20fun%20plugin!' &&
+		git reset --hard 'refs/remotes/origin/more%20fun%20plugin!' &&
 		echo hello >> foo &&
 		git commit -m 'hello' -- foo &&
 		git svn dcommit
@@ -64,7 +64,7 @@ test_expect_success 'test dcommit to funky branch' "
 test_expect_success 'test dcommit to scary branch' '
 	(
 		cd project &&
-		git reset --hard "refs/remotes/$scary_ref" &&
+		git reset --hard "refs/remotes/origin/$scary_ref" &&
 		echo urls are scary >> foo &&
 		git commit -m "eep" -- foo &&
 		git svn dcommit
@@ -74,7 +74,7 @@ test_expect_success 'test dcommit to scary branch' '
 test_expect_success 'test dcommit to trailing_dotlock branch' '
 	(
 		cd project &&
-		git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
+		git reset --hard "refs/remotes/origin/trailing_dotlock%2Elock" &&
 		echo who names branches like this anyway? >> foo &&
 		git commit -m "bar" -- foo &&
 		git svn dcommit
diff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh
index 1d92c05..1c84ce1 100755
--- a/t/t9120-git-svn-clone-with-percent-escapes.sh
+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh
@@ -58,19 +58,19 @@ test_expect_success 'test clone --stdlayout with percent escapes' '
 	git svn clone --stdlayout "$svnrepo/pr%20ject" percent &&
 	(
 		cd percent &&
-		git rev-parse refs/remotes/trunk^0 &&
-		git rev-parse refs/remotes/b^0 &&
-		git rev-parse refs/remotes/tags/v1^0
+		git rev-parse refs/remotes/origin/trunk^0 &&
+		git rev-parse refs/remotes/origin/b^0 &&
+		git rev-parse refs/remotes/origin/tags/v1^0
 	)
 '
 
 test_expect_success 'test clone -s with unescaped space' '
-	git svn clone -s "$svnrepo/pr ject" space &&
+	git svn clone -s "$svnrepo/pr ject" --prefix origin/ space &&
 	(
 		cd space &&
-		git rev-parse refs/remotes/trunk^0 &&
-		git rev-parse refs/remotes/b^0 &&
-		git rev-parse refs/remotes/tags/v1^0
+		git rev-parse refs/remotes/origin/trunk^0 &&
+		git rev-parse refs/remotes/origin/b^0 &&
+		git rev-parse refs/remotes/origin/tags/v1^0
 	)
 '
 
diff --git a/t/t9125-git-svn-multi-glob-branch-names.sh b/t/t9125-git-svn-multi-glob-branch-names.sh
index 096abd1..0d53fc9 100755
--- a/t/t9125-git-svn-multi-glob-branch-names.sh
+++ b/t/t9125-git-svn-multi-glob-branch-names.sh
@@ -20,14 +20,14 @@ test_expect_success 'test clone with multi-glob in branch names' '
 	git svn clone -T trunk -b branches/*/* -t tags \
 	              "$svnrepo/project" project &&
 	(cd project &&
-		git rev-parse "refs/remotes/v14.1/beta" &&
-		git rev-parse "refs/remotes/v14.1/gold"
+		git rev-parse "refs/remotes/origin/v14.1/beta" &&
+		git rev-parse "refs/remotes/origin/v14.1/gold"
 	)
 	'
 
 test_expect_success 'test dcommit to multi-globbed branch' "
 	(cd project &&
-	git reset --hard 'refs/remotes/v14.1/gold' &&
+	git reset --hard 'refs/remotes/origin/v14.1/gold' &&
 	echo hello >> foo &&
 	git commit -m 'hello' -- foo &&
 	git svn dcommit
diff --git a/t/t9128-git-svn-cmd-branch.sh b/t/t9128-git-svn-cmd-branch.sh
index 4b034a6..4e95f79 100755
--- a/t/t9128-git-svn-cmd-branch.sh
+++ b/t/t9128-git-svn-cmd-branch.sh
@@ -29,30 +29,30 @@ test_expect_success 'initialize svnrepo' '
 test_expect_success 'import into git' '
 	git svn init --stdlayout "$svnrepo" &&
 	git svn fetch &&
-	git checkout remotes/trunk
+	git checkout remotes/origin/trunk
 '
 
 test_expect_success 'git svn branch tests' '
 	git svn branch a &&
 	base=$(git rev-parse HEAD:) &&
-	test $base = $(git rev-parse remotes/a:) &&
+	test $base = $(git rev-parse remotes/origin/a:) &&
 	git svn branch -m "created branch b blah" b &&
-	test $base = $(git rev-parse remotes/b:) &&
+	test $base = $(git rev-parse remotes/origin/b:) &&
 	test_must_fail git branch -m "no branchname" &&
 	git svn branch -n c &&
-	test_must_fail git rev-parse remotes/c &&
+	test_must_fail git rev-parse remotes/origin/c &&
 	test_must_fail git svn branch a &&
 	git svn branch -t tag1 &&
-	test $base = $(git rev-parse remotes/tags/tag1:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag1:) &&
 	git svn branch --tag tag2 &&
-	test $base = $(git rev-parse remotes/tags/tag2:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag2:) &&
 	git svn tag tag3 &&
-	test $base = $(git rev-parse remotes/tags/tag3:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag3:) &&
 	git svn tag -m "created tag4 foo" tag4 &&
-	test $base = $(git rev-parse remotes/tags/tag4:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag4:) &&
 	test_must_fail git svn tag -m "no tagname" &&
 	git svn tag -n tag5 &&
-	test_must_fail git rev-parse remotes/tags/tag5 &&
+	test_must_fail git rev-parse remotes/origin/tags/tag5 &&
 	test_must_fail git svn tag tag1
 '
 
diff --git a/t/t9135-git-svn-moved-branch-empty-file.sh b/t/t9135-git-svn-moved-branch-empty-file.sh
index 5280e5f..93db45d 100755
--- a/t/t9135-git-svn-moved-branch-empty-file.sh
+++ b/t/t9135-git-svn-moved-branch-empty-file.sh
@@ -12,7 +12,7 @@ test_expect_success 'clone using git svn' 'git svn clone -s "$svnrepo" x'
 test_expect_success 'test that b1 exists and is empty' '
 	(
 		cd x &&
-		git reset --hard branch-c &&
+		git reset --hard origin/branch-c &&
 		test -f b1 &&
 		! test -s b1
 	)
diff --git a/t/t9141-git-svn-multiple-branches.sh b/t/t9141-git-svn-multiple-branches.sh
index 3cd0671..8e7f7d6 100755
--- a/t/t9141-git-svn-multiple-branches.sh
+++ b/t/t9141-git-svn-multiple-branches.sh
@@ -66,18 +66,18 @@ test_expect_success 'clone multiple branch and tag paths' '
 		      -t tags_A/* --tags tags_B \
 		      "$svnrepo/project" git_project &&
 	( cd git_project &&
-		git rev-parse refs/remotes/first &&
-		git rev-parse refs/remotes/second &&
-		git rev-parse refs/remotes/1 &&
-		git rev-parse refs/remotes/2 &&
-		git rev-parse refs/remotes/tags/1.0 &&
-		git rev-parse refs/remotes/tags/2.0 &&
-		git rev-parse refs/remotes/tags/3.0 &&
-		git rev-parse refs/remotes/tags/4.0 &&
-		git rev-parse refs/remotes/tags/v5 &&
-		git rev-parse refs/remotes/tags/v6 &&
-		git rev-parse refs/remotes/tags/v7 &&
-		git rev-parse refs/remotes/tags/v8
+		git rev-parse refs/remotes/origin/first &&
+		git rev-parse refs/remotes/origin/second &&
+		git rev-parse refs/remotes/origin/1 &&
+		git rev-parse refs/remotes/origin/2 &&
+		git rev-parse refs/remotes/origin/tags/1.0 &&
+		git rev-parse refs/remotes/origin/tags/2.0 &&
+		git rev-parse refs/remotes/origin/tags/3.0 &&
+		git rev-parse refs/remotes/origin/tags/4.0 &&
+		git rev-parse refs/remotes/origin/tags/v5 &&
+		git rev-parse refs/remotes/origin/tags/v6 &&
+		git rev-parse refs/remotes/origin/tags/v7 &&
+		git rev-parse refs/remotes/origin/tags/v8
 	)
 '
 
@@ -85,8 +85,8 @@ test_expect_success 'Multiple branch or tag paths require -d' '
 	( cd git_project &&
 		test_must_fail git svn branch -m "No new branch" Nope &&
 		test_must_fail git svn tag -m "No new tag" Tagless &&
-		test_must_fail git rev-parse refs/remotes/Nope &&
-		test_must_fail git rev-parse refs/remotes/tags/Tagless
+		test_must_fail git rev-parse refs/remotes/origin/Nope &&
+		test_must_fail git rev-parse refs/remotes/origin/tags/Tagless
 	) &&
 	( cd svn_project &&
 		svn_cmd up &&
diff --git a/t/t9145-git-svn-master-branch.sh b/t/t9145-git-svn-master-branch.sh
index 16852d2..6559137 100755
--- a/t/t9145-git-svn-master-branch.sh
+++ b/t/t9145-git-svn-master-branch.sh
@@ -17,7 +17,7 @@ test_expect_success 'git svn clone --stdlayout sets up trunk as master' '
 	git svn clone -s "$svnrepo" g &&
 	(
 		cd g &&
-		test x`git rev-parse --verify refs/remotes/trunk^0` = \
+		test x`git rev-parse --verify refs/remotes/origin/trunk^0` = \
 		     x`git rev-parse --verify refs/heads/master^0`
 	)
 '
diff --git a/t/t9155-git-svn-fetch-deleted-tag.sh b/t/t9155-git-svn-fetch-deleted-tag.sh
index a486a98..184336f 100755
--- a/t/t9155-git-svn-fetch-deleted-tag.sh
+++ b/t/t9155-git-svn-fetch-deleted-tag.sh
@@ -35,8 +35,8 @@ test_expect_success 'fetch deleted tags from same revision with checksum error'
 	cd git_project &&
 	git svn fetch &&
 
-	git diff --exit-code mybranch:trunk/subdir/file tags/mytag:file &&
-	git diff --exit-code master:subdir/file tags/mytag^:file
+	git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
+	git diff --exit-code master:subdir/file origin/tags/mytag^:file
 '
 
 test_done
diff --git a/t/t9156-git-svn-fetch-deleted-tag-2.sh b/t/t9156-git-svn-fetch-deleted-tag-2.sh
index 5ce7e2f..7a6e33b 100755
--- a/t/t9156-git-svn-fetch-deleted-tag-2.sh
+++ b/t/t9156-git-svn-fetch-deleted-tag-2.sh
@@ -36,9 +36,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro
 	cd git_project &&
 	git svn fetch &&
 
-	git diff --exit-code master:subdir3/file tags/mytag:file &&
-	git diff --exit-code master:subdir2/file tags/mytag^:file &&
-	git diff --exit-code master:subdir1/file tags/mytag^^:file
+	git diff --exit-code master:subdir3/file origin/tags/mytag:file &&
+	git diff --exit-code master:subdir2/file origin/tags/mytag^:file &&
+	git diff --exit-code master:subdir1/file origin/tags/mytag^^:file
 '
 
 test_done
diff --git a/t/t9161-git-svn-mergeinfo-push.sh b/t/t9161-git-svn-mergeinfo-push.sh
index 1eab701..6cb0909 100755
--- a/t/t9161-git-svn-mergeinfo-push.sh
+++ b/t/t9161-git-svn-mergeinfo-push.sh
@@ -18,8 +18,8 @@ test_expect_success 'load svn dump' "
 
 test_expect_success 'propagate merge information' '
 	git config svn.pushmergeinfo yes &&
-	git checkout svnb1 &&
-	git merge --no-ff svnb2 &&
+	git checkout origin/svnb1 &&
+	git merge --no-ff origin/svnb2 &&
 	git svn dcommit
 	'
 
@@ -29,7 +29,7 @@ test_expect_success 'check svn:mergeinfo' '
 	'
 
 test_expect_success 'merge another branch' '
-	git merge --no-ff svnb3 &&
+	git merge --no-ff origin/svnb3 &&
 	git svn dcommit
 	'
 
@@ -40,7 +40,7 @@ test_expect_success 'check primary parent mergeinfo respected' '
 	'
 
 test_expect_success 'merge existing merge' '
-	git merge --no-ff svnb4 &&
+	git merge --no-ff origin/svnb4 &&
 	git svn dcommit
 	'
 
@@ -53,7 +53,7 @@ test_expect_success "check both parents' mergeinfo respected" '
 	'
 
 test_expect_success 'make further commits to branch' '
-	git checkout svnb2 &&
+	git checkout origin/svnb2 &&
 	touch newb2file &&
 	git add newb2file &&
 	git commit -m "later b2 commit" &&
@@ -64,8 +64,8 @@ test_expect_success 'make further commits to branch' '
 	'
 
 test_expect_success 'second forward merge' '
-	git checkout svnb1 &&
-	git merge --no-ff svnb2 &&
+	git checkout origin/svnb1 &&
+	git merge --no-ff origin/svnb2 &&
 	git svn dcommit
 	'
 
@@ -78,8 +78,8 @@ test_expect_success 'check new mergeinfo added' '
 	'
 
 test_expect_success 'reintegration merge' '
-	git checkout svnb4 &&
-	git merge --no-ff svnb1 &&
+	git checkout origin/svnb4 &&
+	git merge --no-ff origin/svnb1 &&
 	git svn dcommit
 	'
 
@@ -92,11 +92,11 @@ test_expect_success 'check reintegration mergeinfo' '
 	'
 
 test_expect_success 'dcommit a merge at the top of a stack' '
-	git checkout svnb1 &&
+	git checkout origin/svnb1 &&
 	touch anotherfile &&
 	git add anotherfile &&
 	git commit -m "a commit" &&
-	git merge svnb4 &&
+	git merge origin/svnb4 &&
 	git svn dcommit
 	'
 
diff --git a/t/t9163-git-svn-reset-clears-caches.sh b/t/t9163-git-svn-reset-clears-caches.sh
index cd4c662..d6245ce 100755
--- a/t/t9163-git-svn-reset-clears-caches.sh
+++ b/t/t9163-git-svn-reset-clears-caches.sh
@@ -70,9 +70,9 @@ test_expect_success 'rebase looses SVN merge (m)' '
 #
 test_expect_success 'reset and fetch gets the SVN merge (m) correctly' '
 	git svn reset -r 3 &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn fetch &&
-	test 2 = $(git cat-file -p trunk|grep parent|wc -l)
+	test 2 = $(git cat-file -p origin/trunk|grep parent|wc -l)
 '
 
 test_done
diff --git a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh
index 13ae7e3..fa3ef3b 100755
--- a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh
+++ b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh
@@ -53,7 +53,7 @@ test_expect_success 'clone svn repo' '
 '
 
 test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&
-	y=$(git rev-parse branch2) &&
+	y=$(git rev-parse origin/branch2) &&
 	test "x$x" = "x$y"
 '
 
diff --git a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh
index af0ec0e..52f2e46 100755
--- a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh
+++ b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh
@@ -46,7 +46,7 @@ test_expect_success 'clone svn repo' '
 '
 
 test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&
-	y=$(git rev-parse branch2) &&
+	y=$(git rev-parse origin/branch2) &&
 	test "x$x" = "x$y"
 '
 
diff --git a/t/t9167-git-svn-cmd-branch-subproject.sh b/t/t9167-git-svn-cmd-branch-subproject.sh
index 53def87..ba35fc0 100755
--- a/t/t9167-git-svn-cmd-branch-subproject.sh
+++ b/t/t9167-git-svn-cmd-branch-subproject.sh
@@ -31,7 +31,7 @@ test_expect_success 'import into git' '
 	git svn init --trunk=trunk/project --branches=branches/*/project \
 		--tags=tags/*/project "$svnrepo" &&
 	git svn fetch &&
-	git checkout remotes/trunk
+	git checkout remotes/origin/trunk
 '
 
 test_expect_success 'git svn branch tests' '
-- 
1.8.4.653.g2df02b3

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples
  2013-10-05 23:30           ` [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Johan Herland
  2013-10-05 23:30             ` [RFC/PATCHv2 2/3] git-svn: Warn about changing default for --prefix in Git v2.0 Johan Herland
  2013-10-05 23:30             ` [RFC/PATCHv2 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given Johan Herland
@ 2013-10-06  9:51             ` Philip Oakley
  2013-10-06 13:46               ` Johan Herland
  2013-10-09  1:33             ` Eric Sunshine
  2013-10-11 12:57             ` [RFC/PATCHv3 0/3] Change git-svn's default --prefix in Git v2.0 Johan Herland
  4 siblings, 1 reply; 23+ messages in thread
From: Philip Oakley @ 2013-10-06  9:51 UTC (permalink / raw)
  To: Johan Herland, git; +Cc: tfnico, Eric Wong

From: "Johan Herland" <johan@herland.net>
> Currently, the git-svn defaults to using an empty prefix, which ends
> up placing the SVN-tracking refs directly in refs/remotes/*. This
> placement runs counter to Git's convention of placing remote-tracking
> branches in refs/remotes/$remote/*.
<snip>
>
> This is also in preparation for changing the default value of --prefix
> at some point in the future.
>
> Cc: Eric Wong <normalperson@yhbt.net>

Excuse my ignorance, but what is the "Carbon copy:" line meant to 
signify?
Should it be a double "Signed-of-by:" or one of the other "-by:" lines?

> Signed-off-by: Johan Herland <johan@herland.net>
> ---
> Documentation/git-svn.txt | 35 +++++++++++++++++++++++++----------
> 1 file changed, 25 insertions(+), 10 deletions(-)
<snip>

Philip Oakley 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples
  2013-10-06  9:51             ` [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Philip Oakley
@ 2013-10-06 13:46               ` Johan Herland
  0 siblings, 0 replies; 23+ messages in thread
From: Johan Herland @ 2013-10-06 13:46 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Git mailing list, Thomas Ferris Nicolaisen, Eric Wong

On Sun, Oct 6, 2013 at 11:51 AM, Philip Oakley <philipoakley@iee.org> wrote:
> From: "Johan Herland" <johan@herland.net>
>> Cc: Eric Wong <normalperson@yhbt.net>
>
> Excuse my ignorance, but what is the "Carbon copy:" line meant to signify?
> Should it be a double "Signed-of-by:" or one of the other "-by:" lines?

No, it's not a Signed-off-by, it's merely a hint to someone that they
might want to take a closer look at this patch.

In this case, I'm Cc-ing Eric Wong, as he is the main git-svn author,
and I consider his feedback on these patches very valuable. When I add
a Cc: to the commit message, git send-email picks it up, and adds him
to the Cc-list of the resulting email. I could have achieved the same
by passing --cc "Eric ..." directly to git-send-email, but sometimes
there might be quite a while between preparing the commit and running
git send-email, and in those cases adding the Cc to the commit message
saves me from forgetting to Cc him when I some time later get around
to running git send-email.

That said, my hope is obviously that Eric will have the
time/energy/motivation to review these patches, so that I (or someone
else) can later replace the "Cc:" line with a corresponding
"Reviewed-by:" or "Acked-by:". Even if that does not happen, and the
"Cc:" line ends up in the recorded history of Git, I don't consider
that a big problem either; a 'git log origin/master | grep "^\s*Cc: "
| wc -l' yields 148 existing cases...

Hope that helps,

...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples
  2013-10-05 23:30           ` [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Johan Herland
                               ` (2 preceding siblings ...)
  2013-10-06  9:51             ` [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Philip Oakley
@ 2013-10-09  1:33             ` Eric Sunshine
  2013-10-09 12:06               ` Johan Herland
  2013-10-11 12:57             ` [RFC/PATCHv3 0/3] Change git-svn's default --prefix in Git v2.0 Johan Herland
  4 siblings, 1 reply; 23+ messages in thread
From: Eric Sunshine @ 2013-10-09  1:33 UTC (permalink / raw)
  To: Johan Herland; +Cc: Git List, tfnico, Eric Wong

On Sat, Oct 5, 2013 at 7:30 PM, Johan Herland <johan@herland.net> wrote:
> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
> index 4dd3bcb..da00671 100644
> --- a/Documentation/git-svn.txt
> +++ b/Documentation/git-svn.txt
> @@ -973,6 +979,15 @@ without giving any repository layout options.  If the full history with
>  branches and tags is required, the options '--trunk' / '--branches' /
>  '--tags' must be used.
>
> +When using the options for describing the repository layout (--trunk,
> +--tags, --branches, --stdlayout), please also specify the --prefix
> +option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be
> +placed at refs/remotes/origin/* rather than the default refs/remotes/*.
> +The former is more compatible with the layout of Git's "regular"
> +remote-tracking refs (refs/remotes/$remote/*), and may potentially
> +prevent similarly named SVN branches and Git remotes from clobbering
> +eachother.

s/eachother/each other/

>  When using multiple --branches or --tags, 'git svn' does not automatically
>  handle name collisions (for example, if two branches from different paths have
>  the same name, or if a branch and a tag have the same name).  In these cases,
> @@ -1035,8 +1050,8 @@ comma-separated list of names within braces. For example:
>  [svn-remote "huge-project"]
>         url = http://server.org/svn
>         fetch = trunk/src:refs/remotes/trunk
> -       branches = branches/{red,green}/src:refs/remotes/branches/*
> -       tags = tags/{1.0,2.0}/src:refs/remotes/tags/*
> +       branches = branches/{red,green}/src:refs/remotes/project-a/branches/*
> +       tags = tags/{1.0,2.0}/src:refs/remotes/project-a/tags/*
>  ------------------------------------------------------------------------
>
>  Multiple fetch, branches, and tags keys are supported:
> --

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [RFC/PATCHv2 2/3] git-svn: Warn about changing default for --prefix in Git v2.0
  2013-10-05 23:30             ` [RFC/PATCHv2 2/3] git-svn: Warn about changing default for --prefix in Git v2.0 Johan Herland
@ 2013-10-09  1:34               ` Eric Sunshine
  2013-10-09 12:18                 ` Johan Herland
  0 siblings, 1 reply; 23+ messages in thread
From: Eric Sunshine @ 2013-10-09  1:34 UTC (permalink / raw)
  To: Johan Herland; +Cc: Git List, tfnico, Eric Wong

On Sat, Oct 5, 2013 at 7:30 PM, Johan Herland <johan@herland.net> wrote:
> diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh
> index b7ef9e2..1c8d049 100755
> --- a/t/t9117-git-svn-init-clone.sh
> +++ b/t/t9117-git-svn-init-clone.sh
> @@ -52,4 +52,71 @@ test_expect_success 'clone to target directory with --stdlayout' '
>         rm -rf target
>         '
>
> +test_expect_success 'clone without -s/-T/-b/-t does not warn' '
> +       test ! -d trunk &&
> +       git svn clone "$svnrepo"/project/trunk 2>warning &&
> +       test_must_fail grep -q prefix warning &&
> +       rm -rf trunk &&
> +       rm -f warning
> +       '
> +
> +test_svn_configured_prefix () {
> +       prefix=$1

Did you want to maintain the &&-chain here?

> +       cat >expect <<EOF

And here?

> +project/trunk:refs/remotes/${prefix}trunk
> +project/branches/*:refs/remotes/${prefix}*
> +project/tags/*:refs/remotes/${prefix}tags/*
> +EOF
> +       test ! -f actual &&
> +       git --git-dir=project/.git config svn-remote.svn.fetch >>actual &&
> +       git --git-dir=project/.git config svn-remote.svn.branches >>actual &&
> +       git --git-dir=project/.git config svn-remote.svn.tags >>actual &&
> +       test_cmp expect actual &&
> +       rm -f expect actual
> +}

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples
  2013-10-09  1:33             ` Eric Sunshine
@ 2013-10-09 12:06               ` Johan Herland
  0 siblings, 0 replies; 23+ messages in thread
From: Johan Herland @ 2013-10-09 12:06 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Git List, Thomas Ferris Nicolaisen, Eric Wong

On Wed, Oct 9, 2013 at 3:33 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> On Sat, Oct 5, 2013 at 7:30 PM, Johan Herland <johan@herland.net> wrote:
>> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
>> index 4dd3bcb..da00671 100644
>> --- a/Documentation/git-svn.txt
>> +++ b/Documentation/git-svn.txt
>> @@ -973,6 +979,15 @@ without giving any repository layout options.  If the full history with
>>  branches and tags is required, the options '--trunk' / '--branches' /
>>  '--tags' must be used.
>>
>> +When using the options for describing the repository layout (--trunk,
>> +--tags, --branches, --stdlayout), please also specify the --prefix
>> +option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be
>> +placed at refs/remotes/origin/* rather than the default refs/remotes/*.
>> +The former is more compatible with the layout of Git's "regular"
>> +remote-tracking refs (refs/remotes/$remote/*), and may potentially
>> +prevent similarly named SVN branches and Git remotes from clobbering
>> +eachother.
>
> s/eachother/each other/

Thanks, will fix.

...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [RFC/PATCHv2 2/3] git-svn: Warn about changing default for --prefix in Git v2.0
  2013-10-09  1:34               ` Eric Sunshine
@ 2013-10-09 12:18                 ` Johan Herland
  0 siblings, 0 replies; 23+ messages in thread
From: Johan Herland @ 2013-10-09 12:18 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Git List, Thomas Ferris Nicolaisen, Eric Wong

On Wed, Oct 9, 2013 at 3:34 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> On Sat, Oct 5, 2013 at 7:30 PM, Johan Herland <johan@herland.net> wrote:
>> diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh
>> index b7ef9e2..1c8d049 100755
>> --- a/t/t9117-git-svn-init-clone.sh
>> +++ b/t/t9117-git-svn-init-clone.sh
>> @@ -52,4 +52,71 @@ test_expect_success 'clone to target directory with --stdlayout' '
>>         rm -rf target
>>         '
>>
>> +test_expect_success 'clone without -s/-T/-b/-t does not warn' '
>> +       test ! -d trunk &&
>> +       git svn clone "$svnrepo"/project/trunk 2>warning &&
>> +       test_must_fail grep -q prefix warning &&
>> +       rm -rf trunk &&
>> +       rm -f warning
>> +       '
>> +
>> +test_svn_configured_prefix () {
>> +       prefix=$1
>
> Did you want to maintain the &&-chain here?
>
>> +       cat >expect <<EOF
>
> And here?

Yes, will add && in both places. Thanks.

...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [RFC/PATCHv3 0/3] Change git-svn's default --prefix in Git v2.0
  2013-10-05 23:30           ` [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Johan Herland
                               ` (3 preceding siblings ...)
  2013-10-09  1:33             ` Eric Sunshine
@ 2013-10-11 12:57             ` Johan Herland
  2013-10-11 12:57               ` [RFC/PATCHv3 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Johan Herland
                                 ` (2 more replies)
  4 siblings, 3 replies; 23+ messages in thread
From: Johan Herland @ 2013-10-11 12:57 UTC (permalink / raw)
  To: git; +Cc: tfnico, Johan Herland

Hi,

Another iteration, identical to v2, except for the fixes suggested by
Eric Sunshine.

...Johan


Johan Herland (3):
  Documentation/git-svn: Promote the use of --prefix in docs + examples
  git-svn: Warn about changing default for --prefix in Git v2.0
  Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given

 Documentation/git-svn.txt                        | 27 ++++++----
 git-svn.perl                                     |  2 +-
 t/t9107-git-svn-migrate.sh                       | 54 +++++++++----------
 t/t9114-git-svn-dcommit-merge.sh                 |  4 +-
 t/t9116-git-svn-log.sh                           | 46 ++++++++--------
 t/t9117-git-svn-init-clone.sh                    | 67 ++++++++++++++++++++++++
 t/t9118-git-svn-funky-branch-names.sh            | 20 +++----
 t/t9120-git-svn-clone-with-percent-escapes.sh    | 14 ++---
 t/t9125-git-svn-multi-glob-branch-names.sh       |  6 +--
 t/t9128-git-svn-cmd-branch.sh                    | 18 +++----
 t/t9135-git-svn-moved-branch-empty-file.sh       |  2 +-
 t/t9141-git-svn-multiple-branches.sh             | 28 +++++-----
 t/t9145-git-svn-master-branch.sh                 |  2 +-
 t/t9155-git-svn-fetch-deleted-tag.sh             |  4 +-
 t/t9156-git-svn-fetch-deleted-tag-2.sh           |  6 +--
 t/t9161-git-svn-mergeinfo-push.sh                | 22 ++++----
 t/t9163-git-svn-reset-clears-caches.sh           |  4 +-
 t/t9165-git-svn-fetch-merge-branch-of-branch.sh  |  2 +-
 t/t9166-git-svn-fetch-merge-branch-of-branch2.sh |  2 +-
 t/t9167-git-svn-cmd-branch-subproject.sh         |  2 +-
 20 files changed, 203 insertions(+), 129 deletions(-)

-- 
1.8.4.653.g2df02b3

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [RFC/PATCHv3 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples
  2013-10-11 12:57             ` [RFC/PATCHv3 0/3] Change git-svn's default --prefix in Git v2.0 Johan Herland
@ 2013-10-11 12:57               ` Johan Herland
  2013-10-11 12:57               ` [RFC/PATCHv3 2/3] git-svn: Warn about changing default for --prefix in Git v2.0 Johan Herland
  2013-10-11 12:57               ` [RFC/PATCHv3 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given Johan Herland
  2 siblings, 0 replies; 23+ messages in thread
From: Johan Herland @ 2013-10-11 12:57 UTC (permalink / raw)
  To: git; +Cc: tfnico, Johan Herland, Eric Wong

Currently, the git-svn defaults to using an empty prefix, which ends
up placing the SVN-tracking refs directly in refs/remotes/*. This
placement runs counter to Git's convention of placing remote-tracking
branches in refs/remotes/$remote/*.

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.

At this time, the user is better off using the --prefix=foo/ (the
trailing slash is important) to git svn init/clone, to cause the
SVN-tracking refs to be placed at refs/remotes/foo/* instead of
refs/remotes/*. This patch updates the documentation to encourage
use of --prefix.

This is also in preparation for changing the default value of --prefix
at some point in the future.

Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
---
 Documentation/git-svn.txt | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 4dd3bcb..ac0c72f 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -79,8 +79,13 @@ COMMANDS
 	trailing slash, so be sure you include one in the
 	argument if that is what you want.  If --branches/-b is
 	specified, the prefix must include a trailing slash.
-	Setting a prefix is useful if you wish to track multiple
-	projects that share a common repository.
+	Setting a prefix (with a trailing slash) is strongly
+	encouraged in any case, as your SVN-tracking refs will
+	then be located at "refs/remotes/$prefix/*", which is
+	compatible with Git's own remote-tracking ref layout
+	(refs/remotes/$remote/*). Setting a prefix is also useful
+	if you wish to track multiple projects that share a common
+	repository.
 --ignore-paths=<regex>;;
 	When passed to 'init' or 'clone' this regular expression will
 	be preserved as a config key.  See 'fetch' for a description
@@ -804,16 +809,16 @@ Tracking and contributing to an entire Subversion-managed project
 
 ------------------------------------------------------------------------
 # Clone a repo with standard SVN directory layout (like git clone):
-	git svn clone http://svn.example.com/project --stdlayout
+	git svn clone http://svn.example.com/project --stdlayout --prefix svn/
 # Or, if the repo uses a non-standard directory layout:
-	git svn clone http://svn.example.com/project -T tr -b branch -t tag
+	git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/
 # View all branches and tags you have cloned:
 	git branch -r
 # Create a new branch in SVN
     git svn branch waldo
 # Reset your master to trunk (or any other branch, replacing 'trunk'
 # with the appropriate name):
-	git reset --hard remotes/trunk
+	git reset --hard svn/trunk
 # You may only dcommit to one branch/tag/trunk at a time.  The usage
 # of dcommit/rebase/show-ignore should be the same as above.
 ------------------------------------------------------------------------
@@ -827,7 +832,7 @@ have each person clone that repository with 'git clone':
 
 ------------------------------------------------------------------------
 # Do the initial import on a server
-	ssh server "cd /pub && git svn clone http://svn.example.com/project
+	ssh server "cd /pub && git svn clone http://svn.example.com/project [options...]"
 # Clone locally - make sure the refs/remotes/ space matches the server
 	mkdir project
 	cd project
@@ -840,8 +845,9 @@ have each person clone that repository with 'git clone':
 	git config --remove-section remote.origin
 # Create a local branch from one of the branches just fetched
 	git checkout -b master FETCH_HEAD
-# Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
-	git svn init http://svn.example.com/project
+# Initialize 'git svn' locally (be sure to use the same URL and
+# --stdlayout/-T/-b/-t/--prefix options as were used on server)
+	git svn init http://svn.example.com/project [options...]
 # Pull the latest changes from Subversion
 	git svn rebase
 ------------------------------------------------------------------------
@@ -973,6 +979,15 @@ without giving any repository layout options.  If the full history with
 branches and tags is required, the options '--trunk' / '--branches' /
 '--tags' must be used.
 
+When using the options for describing the repository layout (--trunk,
+--tags, --branches, --stdlayout), please also specify the --prefix
+option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be
+placed at refs/remotes/origin/* rather than the default refs/remotes/*.
+The former is more compatible with the layout of Git's "regular"
+remote-tracking refs (refs/remotes/$remote/*), and may potentially
+prevent similarly named SVN branches and Git remotes from clobbering
+each other.
+
 When using multiple --branches or --tags, 'git svn' does not automatically
 handle name collisions (for example, if two branches from different paths have
 the same name, or if a branch and a tag have the same name).  In these cases,
@@ -1035,8 +1050,8 @@ comma-separated list of names within braces. For example:
 [svn-remote "huge-project"]
 	url = http://server.org/svn
 	fetch = trunk/src:refs/remotes/trunk
-	branches = branches/{red,green}/src:refs/remotes/branches/*
-	tags = tags/{1.0,2.0}/src:refs/remotes/tags/*
+	branches = branches/{red,green}/src:refs/remotes/project-a/branches/*
+	tags = tags/{1.0,2.0}/src:refs/remotes/project-a/tags/*
 ------------------------------------------------------------------------
 
 Multiple fetch, branches, and tags keys are supported:
-- 
1.8.4.653.g2df02b3

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [RFC/PATCHv3 2/3] git-svn: Warn about changing default for --prefix in Git v2.0
  2013-10-11 12:57             ` [RFC/PATCHv3 0/3] Change git-svn's default --prefix in Git v2.0 Johan Herland
  2013-10-11 12:57               ` [RFC/PATCHv3 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Johan Herland
@ 2013-10-11 12:57               ` Johan Herland
  2013-10-12 22:33                 ` Eric Wong
  2013-10-11 12:57               ` [RFC/PATCHv3 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given Johan Herland
  2 siblings, 1 reply; 23+ messages in thread
From: Johan Herland @ 2013-10-11 12:57 UTC (permalink / raw)
  To: git; +Cc: tfnico, Johan Herland, Eric Wong

In Git v2.0, we will change the default --prefix for init/clone from
none/empty to "origin/" (which causes SVN-tracking branches to be
placed at refs/remotes/origin/* instead of refs/remotes/*).

This patch warns users about the upcoming change, both in the git-svn
manual page, and on stderr when running init/clone in the "multi-mode"
without providing a --prefix.

Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
---
 Documentation/git-svn.txt     | 11 ++++++-
 git-svn.perl                  | 12 +++++++-
 t/t9117-git-svn-init-clone.sh | 67 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index ac0c72f..7980c20 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -86,6 +86,14 @@ COMMANDS
 	(refs/remotes/$remote/*). Setting a prefix is also useful
 	if you wish to track multiple projects that share a common
 	repository.
++
+NOTE: In Git v2.0, the default prefix will CHANGE from "" (no prefix)
+to "origin/". This is done to put SVN-tracking refs at
+"refs/remotes/origin/*" instead of "refs/remotes/*", and make them
+more compatible with how Git's own remote-tracking refs are organized
+(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,
+by using the --prefix option.
+
 --ignore-paths=<regex>;;
 	When passed to 'init' or 'clone' this regular expression will
 	be preserved as a config key.  See 'fetch' for a description
@@ -986,7 +994,8 @@ placed at refs/remotes/origin/* rather than the default refs/remotes/*.
 The former is more compatible with the layout of Git's "regular"
 remote-tracking refs (refs/remotes/$remote/*), and may potentially
 prevent similarly named SVN branches and Git remotes from clobbering
-each other.
+each other. In Git v2.0 the default prefix used (i.e. when no --prefix
+is given) will change from "" (no prefix) to "origin/".
 
 When using multiple --branches or --tags, 'git svn' does not automatically
 handle name collisions (for example, if two branches from different paths have
diff --git a/git-svn.perl b/git-svn.perl
index ff1ce3d..0443a4f 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1389,7 +1389,17 @@ sub cmd_multi_init {
 		usage(1);
 	}
 
-	$_prefix = '' unless defined $_prefix;
+	unless (defined $_prefix) {
+		$_prefix = '';
+		warn <<EOF
+WARNING: --prefix is not given, defaulting to empty prefix.
+         This is probably not what you want! In order to stay compatible
+         with regular remote-tracking refs, provide a prefix like
+         --prefix=origin/ (remember the trailing slash), which will cause
+         the SVN-tracking refs to be placed at refs/remotes/origin/*.
+NOTE: In Git v2.0, the default prefix will change from empty to 'origin/'.
+EOF
+	}
 	if (defined $url) {
 		$url = canonicalize_url($url);
 		init_subdir(@_);
diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh
index b7ef9e2..69e9c0d 100755
--- a/t/t9117-git-svn-init-clone.sh
+++ b/t/t9117-git-svn-init-clone.sh
@@ -52,4 +52,71 @@ test_expect_success 'clone to target directory with --stdlayout' '
 	rm -rf target
 	'
 
+test_expect_success 'init without -s/-T/-b/-t does not warn' '
+	test ! -d trunk &&
+	git svn init "$svnrepo"/project/trunk trunk 2>warning &&
+	test_must_fail grep -q prefix warning &&
+	rm -rf trunk &&
+	rm -f warning
+	'
+
+test_expect_success 'clone without -s/-T/-b/-t does not warn' '
+	test ! -d trunk &&
+	git svn clone "$svnrepo"/project/trunk 2>warning &&
+	test_must_fail grep -q prefix warning &&
+	rm -rf trunk &&
+	rm -f warning
+	'
+
+test_svn_configured_prefix () {
+	prefix=$1 &&
+	cat >expect <<EOF &&
+project/trunk:refs/remotes/${prefix}trunk
+project/branches/*:refs/remotes/${prefix}*
+project/tags/*:refs/remotes/${prefix}tags/*
+EOF
+	test ! -f actual &&
+	git --git-dir=project/.git config svn-remote.svn.fetch >>actual &&
+	git --git-dir=project/.git config svn-remote.svn.branches >>actual &&
+	git --git-dir=project/.git config svn-remote.svn.tags >>actual &&
+	test_cmp expect actual &&
+	rm -f expect actual
+}
+
+test_expect_success 'init with -s/-T/-b/-t without --prefix warns' '
+	test ! -d project &&
+	git svn init -s "$svnrepo"/project project 2>warning &&
+	grep -q prefix warning &&
+	test_svn_configured_prefix "" &&
+	rm -rf project &&
+	rm -f warning
+	'
+
+test_expect_success 'clone with -s/-T/-b/-t without --prefix warns' '
+	test ! -d project &&
+	git svn clone -s "$svnrepo"/project 2>warning &&
+	grep -q prefix warning &&
+	test_svn_configured_prefix "" &&
+	rm -rf project &&
+	rm -f warning
+	'
+
+test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '
+	test ! -d project &&
+	git svn init -s "$svnrepo"/project project --prefix="" 2>warning &&
+	test_must_fail grep -q prefix warning &&
+	test_svn_configured_prefix "" &&
+	rm -rf project &&
+	rm -f warning
+	'
+
+test_expect_success 'clone with -s/-T/-b/-t and --prefix does not warn' '
+	test ! -d project &&
+	git svn clone -s "$svnrepo"/project --prefix="" 2>warning &&
+	test_must_fail grep -q prefix warning &&
+	test_svn_configured_prefix "" &&
+	rm -rf project &&
+	rm -f warning
+	'
+
 test_done
-- 
1.8.4.653.g2df02b3

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [RFC/PATCHv3 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given
  2013-10-11 12:57             ` [RFC/PATCHv3 0/3] Change git-svn's default --prefix in Git v2.0 Johan Herland
  2013-10-11 12:57               ` [RFC/PATCHv3 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Johan Herland
  2013-10-11 12:57               ` [RFC/PATCHv3 2/3] git-svn: Warn about changing default for --prefix in Git v2.0 Johan Herland
@ 2013-10-11 12:57               ` Johan Herland
  2014-04-19  8:32                 ` Eric Wong
  2 siblings, 1 reply; 23+ messages in thread
From: Johan Herland @ 2013-10-11 12:57 UTC (permalink / raw)
  To: git; +Cc: tfnico, Johan Herland, Eric Wong

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.)

Suggested-by: Thomas Ferris Nicolaisen <tfnico@gmail.com>
Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
---
 Documentation/git-svn.txt                        | 19 +--------
 git-svn.perl                                     | 12 +-----
 t/t9107-git-svn-migrate.sh                       | 54 ++++++++++++------------
 t/t9114-git-svn-dcommit-merge.sh                 |  4 +-
 t/t9116-git-svn-log.sh                           | 46 ++++++++++----------
 t/t9117-git-svn-init-clone.sh                    | 16 +++----
 t/t9118-git-svn-funky-branch-names.sh            | 20 ++++-----
 t/t9120-git-svn-clone-with-percent-escapes.sh    | 14 +++---
 t/t9125-git-svn-multi-glob-branch-names.sh       |  6 +--
 t/t9128-git-svn-cmd-branch.sh                    | 18 ++++----
 t/t9135-git-svn-moved-branch-empty-file.sh       |  2 +-
 t/t9141-git-svn-multiple-branches.sh             | 28 ++++++------
 t/t9145-git-svn-master-branch.sh                 |  2 +-
 t/t9155-git-svn-fetch-deleted-tag.sh             |  4 +-
 t/t9156-git-svn-fetch-deleted-tag-2.sh           |  6 +--
 t/t9161-git-svn-mergeinfo-push.sh                | 22 +++++-----
 t/t9163-git-svn-reset-clears-caches.sh           |  4 +-
 t/t9165-git-svn-fetch-merge-branch-of-branch.sh  |  2 +-
 t/t9166-git-svn-fetch-merge-branch-of-branch2.sh |  2 +-
 t/t9167-git-svn-cmd-branch-subproject.sh         |  2 +-
 20 files changed, 128 insertions(+), 155 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 7980c20..43da05a 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -86,14 +86,7 @@ COMMANDS
 	(refs/remotes/$remote/*). Setting a prefix is also useful
 	if you wish to track multiple projects that share a common
 	repository.
-+
-NOTE: In Git v2.0, the default prefix will CHANGE from "" (no prefix)
-to "origin/". This is done to put SVN-tracking refs at
-"refs/remotes/origin/*" instead of "refs/remotes/*", and make them
-more compatible with how Git's own remote-tracking refs are organized
-(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,
-by using the --prefix option.
-
+	By default, the prefix is set to 'origin/'.
 --ignore-paths=<regex>;;
 	When passed to 'init' or 'clone' this regular expression will
 	be preserved as a config key.  See 'fetch' for a description
@@ -987,16 +980,6 @@ without giving any repository layout options.  If the full history with
 branches and tags is required, the options '--trunk' / '--branches' /
 '--tags' must be used.
 
-When using the options for describing the repository layout (--trunk,
---tags, --branches, --stdlayout), please also specify the --prefix
-option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be
-placed at refs/remotes/origin/* rather than the default refs/remotes/*.
-The former is more compatible with the layout of Git's "regular"
-remote-tracking refs (refs/remotes/$remote/*), and may potentially
-prevent similarly named SVN branches and Git remotes from clobbering
-each other. In Git v2.0 the default prefix used (i.e. when no --prefix
-is given) will change from "" (no prefix) to "origin/".
-
 When using multiple --branches or --tags, 'git svn' does not automatically
 handle name collisions (for example, if two branches from different paths have
 the same name, or if a branch and a tag have the same name).  In these cases,
diff --git a/git-svn.perl b/git-svn.perl
index 0443a4f..ad3fe66 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1389,17 +1389,7 @@ sub cmd_multi_init {
 		usage(1);
 	}
 
-	unless (defined $_prefix) {
-		$_prefix = '';
-		warn <<EOF
-WARNING: --prefix is not given, defaulting to empty prefix.
-         This is probably not what you want! In order to stay compatible
-         with regular remote-tracking refs, provide a prefix like
-         --prefix=origin/ (remember the trailing slash), which will cause
-         the SVN-tracking refs to be placed at refs/remotes/origin/*.
-NOTE: In Git v2.0, the default prefix will change from empty to 'origin/'.
-EOF
-	}
+	$_prefix = 'origin/' unless defined $_prefix;
 	if (defined $url) {
 		$url = canonicalize_url($url);
 		init_subdir(@_);
diff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh
index ee73013..6e69fc4 100755
--- a/t/t9107-git-svn-migrate.sh
+++ b/t/t9107-git-svn-migrate.sh
@@ -45,27 +45,27 @@ test_expect_success 'initialize old-style (v0) git svn layout' '
 test_expect_success 'initialize a multi-repository repo' '
 	git svn init "$svnrepo" -T trunk -t tags -b branches &&
 	git config --get-all svn-remote.svn.fetch > fetch.out &&
-	grep "^trunk:refs/remotes/trunk$" fetch.out &&
+	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
 	test -n "`git config --get svn-remote.svn.branches \
-	            "^branches/\*:refs/remotes/\*$"`" &&
+	            "^branches/\*:refs/remotes/origin/\*$"`" &&
 	test -n "`git config --get svn-remote.svn.tags \
-	            "^tags/\*:refs/remotes/tags/\*$"`" &&
+	            "^tags/\*:refs/remotes/origin/tags/\*$"`" &&
 	git config --unset svn-remote.svn.branches \
-	                        "^branches/\*:refs/remotes/\*$" &&
+	                        "^branches/\*:refs/remotes/origin/\*$" &&
 	git config --unset svn-remote.svn.tags \
-	                        "^tags/\*:refs/remotes/tags/\*$" &&
-	git config --add svn-remote.svn.fetch "branches/a:refs/remotes/a" &&
-	git config --add svn-remote.svn.fetch "branches/b:refs/remotes/b" &&
+	                        "^tags/\*:refs/remotes/origin/tags/\*$" &&
+	git config --add svn-remote.svn.fetch "branches/a:refs/remotes/origin/a" &&
+	git config --add svn-remote.svn.fetch "branches/b:refs/remotes/origin/b" &&
 	for i in tags/0.1 tags/0.2 tags/0.3; do
 		git config --add svn-remote.svn.fetch \
-		                 $i:refs/remotes/$i || exit 1; done &&
+		                 $i:refs/remotes/origin/$i || exit 1; done &&
 	git config --get-all svn-remote.svn.fetch > fetch.out &&
-	grep "^trunk:refs/remotes/trunk$" fetch.out &&
-	grep "^branches/a:refs/remotes/a$" fetch.out &&
-	grep "^branches/b:refs/remotes/b$" fetch.out &&
-	grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
-	grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
-	grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out &&
+	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
+	grep "^branches/a:refs/remotes/origin/a$" fetch.out &&
+	grep "^branches/b:refs/remotes/origin/b$" fetch.out &&
+	grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
+	grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
+	grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
 	grep "^:refs/${remotes_git_svn}" fetch.out
 	'
 
@@ -73,14 +73,14 @@ test_expect_success 'initialize a multi-repository repo' '
 test_expect_success 'multi-fetch works on partial urls + paths' "
 	git svn multi-fetch &&
 	for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
-		git rev-parse --verify refs/remotes/\$i^0 >> refs.out || exit 1;
+		git rev-parse --verify refs/remotes/origin/\$i^0 >> refs.out || exit 1;
 	    done &&
 	test -z \"\`sort < refs.out | uniq -d\`\" &&
 	for i in trunk a b tags/0.1 tags/0.2 tags/0.3; do
 	  for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do
 		if test \$j != \$i; then continue; fi
-	    test -z \"\`git diff refs/remotes/\$i \
-	                         refs/remotes/\$j\`\" ||exit 1; done; done
+	    test -z \"\`git diff refs/remotes/origin/\$i \
+	                         refs/remotes/origin/\$j\`\" ||exit 1; done; done
 	"
 
 test_expect_success 'migrate --minimize on old inited layout' '
@@ -98,27 +98,27 @@ test_expect_success 'migrate --minimize on old inited layout' '
 	git svn migrate --minimize &&
 	test -z "`git config -l | grep "^svn-remote\.git-svn\."`" &&
 	git config --get-all svn-remote.svn.fetch > fetch.out &&
-	grep "^trunk:refs/remotes/trunk$" fetch.out &&
-	grep "^branches/a:refs/remotes/a$" fetch.out &&
-	grep "^branches/b:refs/remotes/b$" fetch.out &&
-	grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
-	grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
-	grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out &&
+	grep "^trunk:refs/remotes/origin/trunk$" fetch.out &&
+	grep "^branches/a:refs/remotes/origin/a$" fetch.out &&
+	grep "^branches/b:refs/remotes/origin/b$" fetch.out &&
+	grep "^tags/0\.1:refs/remotes/origin/tags/0\.1$" fetch.out &&
+	grep "^tags/0\.2:refs/remotes/origin/tags/0\.2$" fetch.out &&
+	grep "^tags/0\.3:refs/remotes/origin/tags/0\.3$" fetch.out &&
 	grep "^:refs/${remotes_git_svn}" fetch.out
 	'
 
 test_expect_success  ".rev_db auto-converted to .rev_map.UUID" '
 	git svn fetch -i trunk &&
-	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)" &&
-	expect="$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_map.*)" &&
+	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)" &&
+	expect="$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_map.*)" &&
 	test -n "$expect" &&
 	rev_db="$(echo $expect | sed -e "s,_map,_db,")" &&
 	convert_to_rev_db "$expect" "$rev_db" &&
 	rm -f "$expect" &&
 	test -f "$rev_db" &&
 	git svn fetch -i trunk &&
-	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)" &&
-	test ! -e "$GIT_DIR"/svn/refs/remotes/trunk/.rev_db &&
+	test -z "$(ls "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)" &&
+	test ! -e "$GIT_DIR"/svn/refs/remotes/origin/trunk/.rev_db &&
 	test -f "$expect"
 	'
 
diff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh
index f524d2f..6f0968a 100755
--- a/t/t9114-git-svn-dcommit-merge.sh
+++ b/t/t9114-git-svn-dcommit-merge.sh
@@ -48,7 +48,7 @@ test_expect_success 'setup svn repository' '
 test_expect_success 'setup git mirror and merge' '
 	git svn init "$svnrepo" -t tags -T trunk -b branches &&
 	git svn fetch &&
-	git checkout -b svn remotes/trunk &&
+	git checkout -b svn remotes/origin/trunk &&
 	git checkout -b merge &&
 	echo new file > new_file &&
 	git add new_file &&
@@ -81,7 +81,7 @@ test_debug 'gitk --all & sleep 1'
 
 test_expect_success 'verify post-merge ancestry' "
 	test x\`git rev-parse --verify refs/heads/svn\` = \
-	     x\`git rev-parse --verify refs/remotes/trunk \` &&
+	     x\`git rev-parse --verify refs/remotes/origin/trunk \` &&
 	test x\`git rev-parse --verify refs/heads/svn^2\` = \
 	     x\`git rev-parse --verify refs/heads/merge\` &&
 	git cat-file commit refs/heads/svn^ | grep '^friend$'
diff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh
index cf4c052..45773ee 100755
--- a/t/t9116-git-svn-log.sh
+++ b/t/t9116-git-svn-log.sh
@@ -20,20 +20,20 @@ test_expect_success 'setup repository and import' '
 	) &&
 	git svn init "$svnrepo" -T trunk -b branches -t tags &&
 	git svn fetch &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	echo bye >> README &&
 	git commit -a -m bye &&
 	git svn dcommit &&
-	git reset --hard a &&
+	git reset --hard origin/a &&
 	echo why >> FEEDME &&
 	git update-index --add FEEDME &&
 	git commit -m feedme &&
 	git svn dcommit &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	echo aye >> README &&
 	git commit -a -m aye &&
 	git svn dcommit &&
-	git reset --hard b &&
+	git reset --hard origin/b &&
 	echo spy >> README &&
 	git commit -a -m spy &&
 	echo try >> README &&
@@ -42,26 +42,26 @@ test_expect_success 'setup repository and import' '
 	'
 
 test_expect_success 'run log' "
-	git reset --hard a &&
-	git svn log -r2 trunk | grep ^r2 &&
-	git svn log -r4 trunk | grep ^r4 &&
+	git reset --hard origin/a &&
+	git svn log -r2 origin/trunk | grep ^r2 &&
+	git svn log -r4 origin/trunk | grep ^r4 &&
 	git svn log -r3 | grep ^r3
 	"
 
 test_expect_success 'run log against a from trunk' "
-	git reset --hard trunk &&
-	git svn log -r3 a | grep ^r3
+	git reset --hard origin/trunk &&
+	git svn log -r3 origin/a | grep ^r3
 	"
 
 printf 'r1 \nr2 \nr4 \n' > expected-range-r1-r2-r4
 
 test_expect_success 'test ascending revision range' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
 	"
 
 test_expect_success 'test ascending revision range with --show-commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
 	"
 
@@ -69,7 +69,7 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' "
 	git svn find-rev r1 >expected-range-r1-r2-r4-sha1 &&
 	git svn find-rev r2 >>expected-range-r1-r2-r4-sha1 &&
 	git svn find-rev r4 >>expected-range-r1-r2-r4-sha1 &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f2 >out &&
 	git rev-parse \$(cat out) >actual &&
 	test_cmp expected-range-r1-r2-r4-sha1 actual
@@ -78,67 +78,67 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' "
 printf 'r4 \nr2 \nr1 \n' > expected-range-r4-r2-r1
 
 test_expect_success 'test descending revision range' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 4:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4-r2-r1 -
 	"
 
 printf 'r1 \nr2 \n' > expected-range-r1-r2
 
 test_expect_success 'test ascending revision range with unreachable revision' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 1:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2 -
 	"
 
 printf 'r2 \nr1 \n' > expected-range-r2-r1
 
 test_expect_success 'test descending revision range with unreachable revision' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2-r1 -
 	"
 
 printf 'r2 \n' > expected-range-r2
 
 test_expect_success 'test ascending revision range with unreachable upper boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 2:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -
 	"
 
 test_expect_success 'test descending revision range with unreachable upper boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:2 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -
 	"
 
 printf 'r4 \n' > expected-range-r4
 
 test_expect_success 'test ascending revision range with unreachable lower boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
 test_expect_success 'test descending revision range with unreachable lower boundary revision and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 4:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
 printf -- '------------------------------------------------------------------------\n' > expected-separator
 
 test_expect_success 'test ascending revision range with unreachable boundary revisions and no commits' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 5:6 | test_cmp expected-separator -
 	"
 
 test_expect_success 'test descending revision range with unreachable boundary revisions and no commits' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 6:5 | test_cmp expected-separator -
 	"
 
 test_expect_success 'test ascending revision range with unreachable boundary revisions and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 3:5 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
 test_expect_success 'test descending revision range with unreachable boundary revisions and 1 commit' "
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn log -r 5:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -
 	"
 
diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh
index 69e9c0d..dfed76f 100755
--- a/t/t9117-git-svn-init-clone.sh
+++ b/t/t9117-git-svn-init-clone.sh
@@ -83,25 +83,25 @@ EOF
 	rm -f expect actual
 }
 
-test_expect_success 'init with -s/-T/-b/-t without --prefix warns' '
+test_expect_success 'init with -s/-T/-b/-t assumes --prefix=origin/' '
 	test ! -d project &&
 	git svn init -s "$svnrepo"/project project 2>warning &&
-	grep -q prefix warning &&
-	test_svn_configured_prefix "" &&
+	test_must_fail grep -q prefix warning &&
+	test_svn_configured_prefix "origin/" &&
 	rm -rf project &&
 	rm -f warning
 	'
 
-test_expect_success 'clone with -s/-T/-b/-t without --prefix warns' '
+test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' '
 	test ! -d project &&
 	git svn clone -s "$svnrepo"/project 2>warning &&
-	grep -q prefix warning &&
-	test_svn_configured_prefix "" &&
+	test_must_fail grep -q prefix warning &&
+	test_svn_configured_prefix "origin/" &&
 	rm -rf project &&
 	rm -f warning
 	'
 
-test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '
+test_expect_success 'init with -s/-T/-b/-t and --prefix="" still works' '
 	test ! -d project &&
 	git svn init -s "$svnrepo"/project project --prefix="" 2>warning &&
 	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' '
 	rm -f warning
 	'
 
-test_expect_success 'clone with -s/-T/-b/-t and --prefix does not warn' '
+test_expect_success 'clone with -s/-T/-b/-t and --prefix="" still works' '
 	test ! -d project &&
 	git svn clone -s "$svnrepo"/project --prefix="" 2>warning &&
 	test_must_fail grep -q prefix warning &&
diff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh
index 15f93b4..ed4d136 100755
--- a/t/t9118-git-svn-funky-branch-names.sh
+++ b/t/t9118-git-svn-funky-branch-names.sh
@@ -41,20 +41,20 @@ test_expect_success 'test clone with funky branch names' '
 	git svn clone -s "$svnrepo/pr ject" project &&
 	(
 		cd project &&
-		git rev-parse "refs/remotes/fun%20plugin" &&
-		git rev-parse "refs/remotes/more%20fun%20plugin!" &&
-		git rev-parse "refs/remotes/$scary_ref" &&
-		git rev-parse "refs/remotes/%2Eleading_dot" &&
-		git rev-parse "refs/remotes/trailing_dot%2E" &&
-		git rev-parse "refs/remotes/trailing_dotlock%2Elock" &&
-		git rev-parse "refs/remotes/$non_reflog"
+		git rev-parse "refs/remotes/origin/fun%20plugin" &&
+		git rev-parse "refs/remotes/origin/more%20fun%20plugin!" &&
+		git rev-parse "refs/remotes/origin/$scary_ref" &&
+		git rev-parse "refs/remotes/origin/%2Eleading_dot" &&
+		git rev-parse "refs/remotes/origin/trailing_dot%2E" &&
+		git rev-parse "refs/remotes/origin/trailing_dotlock%2Elock" &&
+		git rev-parse "refs/remotes/origin/$non_reflog"
 	)
 	'
 
 test_expect_success 'test dcommit to funky branch' "
 	(
 		cd project &&
-		git reset --hard 'refs/remotes/more%20fun%20plugin!' &&
+		git reset --hard 'refs/remotes/origin/more%20fun%20plugin!' &&
 		echo hello >> foo &&
 		git commit -m 'hello' -- foo &&
 		git svn dcommit
@@ -64,7 +64,7 @@ test_expect_success 'test dcommit to funky branch' "
 test_expect_success 'test dcommit to scary branch' '
 	(
 		cd project &&
-		git reset --hard "refs/remotes/$scary_ref" &&
+		git reset --hard "refs/remotes/origin/$scary_ref" &&
 		echo urls are scary >> foo &&
 		git commit -m "eep" -- foo &&
 		git svn dcommit
@@ -74,7 +74,7 @@ test_expect_success 'test dcommit to scary branch' '
 test_expect_success 'test dcommit to trailing_dotlock branch' '
 	(
 		cd project &&
-		git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
+		git reset --hard "refs/remotes/origin/trailing_dotlock%2Elock" &&
 		echo who names branches like this anyway? >> foo &&
 		git commit -m "bar" -- foo &&
 		git svn dcommit
diff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh
index 1d92c05..1c84ce1 100755
--- a/t/t9120-git-svn-clone-with-percent-escapes.sh
+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh
@@ -58,19 +58,19 @@ test_expect_success 'test clone --stdlayout with percent escapes' '
 	git svn clone --stdlayout "$svnrepo/pr%20ject" percent &&
 	(
 		cd percent &&
-		git rev-parse refs/remotes/trunk^0 &&
-		git rev-parse refs/remotes/b^0 &&
-		git rev-parse refs/remotes/tags/v1^0
+		git rev-parse refs/remotes/origin/trunk^0 &&
+		git rev-parse refs/remotes/origin/b^0 &&
+		git rev-parse refs/remotes/origin/tags/v1^0
 	)
 '
 
 test_expect_success 'test clone -s with unescaped space' '
-	git svn clone -s "$svnrepo/pr ject" space &&
+	git svn clone -s "$svnrepo/pr ject" --prefix origin/ space &&
 	(
 		cd space &&
-		git rev-parse refs/remotes/trunk^0 &&
-		git rev-parse refs/remotes/b^0 &&
-		git rev-parse refs/remotes/tags/v1^0
+		git rev-parse refs/remotes/origin/trunk^0 &&
+		git rev-parse refs/remotes/origin/b^0 &&
+		git rev-parse refs/remotes/origin/tags/v1^0
 	)
 '
 
diff --git a/t/t9125-git-svn-multi-glob-branch-names.sh b/t/t9125-git-svn-multi-glob-branch-names.sh
index 096abd1..0d53fc9 100755
--- a/t/t9125-git-svn-multi-glob-branch-names.sh
+++ b/t/t9125-git-svn-multi-glob-branch-names.sh
@@ -20,14 +20,14 @@ test_expect_success 'test clone with multi-glob in branch names' '
 	git svn clone -T trunk -b branches/*/* -t tags \
 	              "$svnrepo/project" project &&
 	(cd project &&
-		git rev-parse "refs/remotes/v14.1/beta" &&
-		git rev-parse "refs/remotes/v14.1/gold"
+		git rev-parse "refs/remotes/origin/v14.1/beta" &&
+		git rev-parse "refs/remotes/origin/v14.1/gold"
 	)
 	'
 
 test_expect_success 'test dcommit to multi-globbed branch' "
 	(cd project &&
-	git reset --hard 'refs/remotes/v14.1/gold' &&
+	git reset --hard 'refs/remotes/origin/v14.1/gold' &&
 	echo hello >> foo &&
 	git commit -m 'hello' -- foo &&
 	git svn dcommit
diff --git a/t/t9128-git-svn-cmd-branch.sh b/t/t9128-git-svn-cmd-branch.sh
index 4b034a6..4e95f79 100755
--- a/t/t9128-git-svn-cmd-branch.sh
+++ b/t/t9128-git-svn-cmd-branch.sh
@@ -29,30 +29,30 @@ test_expect_success 'initialize svnrepo' '
 test_expect_success 'import into git' '
 	git svn init --stdlayout "$svnrepo" &&
 	git svn fetch &&
-	git checkout remotes/trunk
+	git checkout remotes/origin/trunk
 '
 
 test_expect_success 'git svn branch tests' '
 	git svn branch a &&
 	base=$(git rev-parse HEAD:) &&
-	test $base = $(git rev-parse remotes/a:) &&
+	test $base = $(git rev-parse remotes/origin/a:) &&
 	git svn branch -m "created branch b blah" b &&
-	test $base = $(git rev-parse remotes/b:) &&
+	test $base = $(git rev-parse remotes/origin/b:) &&
 	test_must_fail git branch -m "no branchname" &&
 	git svn branch -n c &&
-	test_must_fail git rev-parse remotes/c &&
+	test_must_fail git rev-parse remotes/origin/c &&
 	test_must_fail git svn branch a &&
 	git svn branch -t tag1 &&
-	test $base = $(git rev-parse remotes/tags/tag1:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag1:) &&
 	git svn branch --tag tag2 &&
-	test $base = $(git rev-parse remotes/tags/tag2:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag2:) &&
 	git svn tag tag3 &&
-	test $base = $(git rev-parse remotes/tags/tag3:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag3:) &&
 	git svn tag -m "created tag4 foo" tag4 &&
-	test $base = $(git rev-parse remotes/tags/tag4:) &&
+	test $base = $(git rev-parse remotes/origin/tags/tag4:) &&
 	test_must_fail git svn tag -m "no tagname" &&
 	git svn tag -n tag5 &&
-	test_must_fail git rev-parse remotes/tags/tag5 &&
+	test_must_fail git rev-parse remotes/origin/tags/tag5 &&
 	test_must_fail git svn tag tag1
 '
 
diff --git a/t/t9135-git-svn-moved-branch-empty-file.sh b/t/t9135-git-svn-moved-branch-empty-file.sh
index 5280e5f..93db45d 100755
--- a/t/t9135-git-svn-moved-branch-empty-file.sh
+++ b/t/t9135-git-svn-moved-branch-empty-file.sh
@@ -12,7 +12,7 @@ test_expect_success 'clone using git svn' 'git svn clone -s "$svnrepo" x'
 test_expect_success 'test that b1 exists and is empty' '
 	(
 		cd x &&
-		git reset --hard branch-c &&
+		git reset --hard origin/branch-c &&
 		test -f b1 &&
 		! test -s b1
 	)
diff --git a/t/t9141-git-svn-multiple-branches.sh b/t/t9141-git-svn-multiple-branches.sh
index 3cd0671..8e7f7d6 100755
--- a/t/t9141-git-svn-multiple-branches.sh
+++ b/t/t9141-git-svn-multiple-branches.sh
@@ -66,18 +66,18 @@ test_expect_success 'clone multiple branch and tag paths' '
 		      -t tags_A/* --tags tags_B \
 		      "$svnrepo/project" git_project &&
 	( cd git_project &&
-		git rev-parse refs/remotes/first &&
-		git rev-parse refs/remotes/second &&
-		git rev-parse refs/remotes/1 &&
-		git rev-parse refs/remotes/2 &&
-		git rev-parse refs/remotes/tags/1.0 &&
-		git rev-parse refs/remotes/tags/2.0 &&
-		git rev-parse refs/remotes/tags/3.0 &&
-		git rev-parse refs/remotes/tags/4.0 &&
-		git rev-parse refs/remotes/tags/v5 &&
-		git rev-parse refs/remotes/tags/v6 &&
-		git rev-parse refs/remotes/tags/v7 &&
-		git rev-parse refs/remotes/tags/v8
+		git rev-parse refs/remotes/origin/first &&
+		git rev-parse refs/remotes/origin/second &&
+		git rev-parse refs/remotes/origin/1 &&
+		git rev-parse refs/remotes/origin/2 &&
+		git rev-parse refs/remotes/origin/tags/1.0 &&
+		git rev-parse refs/remotes/origin/tags/2.0 &&
+		git rev-parse refs/remotes/origin/tags/3.0 &&
+		git rev-parse refs/remotes/origin/tags/4.0 &&
+		git rev-parse refs/remotes/origin/tags/v5 &&
+		git rev-parse refs/remotes/origin/tags/v6 &&
+		git rev-parse refs/remotes/origin/tags/v7 &&
+		git rev-parse refs/remotes/origin/tags/v8
 	)
 '
 
@@ -85,8 +85,8 @@ test_expect_success 'Multiple branch or tag paths require -d' '
 	( cd git_project &&
 		test_must_fail git svn branch -m "No new branch" Nope &&
 		test_must_fail git svn tag -m "No new tag" Tagless &&
-		test_must_fail git rev-parse refs/remotes/Nope &&
-		test_must_fail git rev-parse refs/remotes/tags/Tagless
+		test_must_fail git rev-parse refs/remotes/origin/Nope &&
+		test_must_fail git rev-parse refs/remotes/origin/tags/Tagless
 	) &&
 	( cd svn_project &&
 		svn_cmd up &&
diff --git a/t/t9145-git-svn-master-branch.sh b/t/t9145-git-svn-master-branch.sh
index 16852d2..6559137 100755
--- a/t/t9145-git-svn-master-branch.sh
+++ b/t/t9145-git-svn-master-branch.sh
@@ -17,7 +17,7 @@ test_expect_success 'git svn clone --stdlayout sets up trunk as master' '
 	git svn clone -s "$svnrepo" g &&
 	(
 		cd g &&
-		test x`git rev-parse --verify refs/remotes/trunk^0` = \
+		test x`git rev-parse --verify refs/remotes/origin/trunk^0` = \
 		     x`git rev-parse --verify refs/heads/master^0`
 	)
 '
diff --git a/t/t9155-git-svn-fetch-deleted-tag.sh b/t/t9155-git-svn-fetch-deleted-tag.sh
index a486a98..184336f 100755
--- a/t/t9155-git-svn-fetch-deleted-tag.sh
+++ b/t/t9155-git-svn-fetch-deleted-tag.sh
@@ -35,8 +35,8 @@ test_expect_success 'fetch deleted tags from same revision with checksum error'
 	cd git_project &&
 	git svn fetch &&
 
-	git diff --exit-code mybranch:trunk/subdir/file tags/mytag:file &&
-	git diff --exit-code master:subdir/file tags/mytag^:file
+	git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&
+	git diff --exit-code master:subdir/file origin/tags/mytag^:file
 '
 
 test_done
diff --git a/t/t9156-git-svn-fetch-deleted-tag-2.sh b/t/t9156-git-svn-fetch-deleted-tag-2.sh
index 5ce7e2f..7a6e33b 100755
--- a/t/t9156-git-svn-fetch-deleted-tag-2.sh
+++ b/t/t9156-git-svn-fetch-deleted-tag-2.sh
@@ -36,9 +36,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro
 	cd git_project &&
 	git svn fetch &&
 
-	git diff --exit-code master:subdir3/file tags/mytag:file &&
-	git diff --exit-code master:subdir2/file tags/mytag^:file &&
-	git diff --exit-code master:subdir1/file tags/mytag^^:file
+	git diff --exit-code master:subdir3/file origin/tags/mytag:file &&
+	git diff --exit-code master:subdir2/file origin/tags/mytag^:file &&
+	git diff --exit-code master:subdir1/file origin/tags/mytag^^:file
 '
 
 test_done
diff --git a/t/t9161-git-svn-mergeinfo-push.sh b/t/t9161-git-svn-mergeinfo-push.sh
index 1eab701..6cb0909 100755
--- a/t/t9161-git-svn-mergeinfo-push.sh
+++ b/t/t9161-git-svn-mergeinfo-push.sh
@@ -18,8 +18,8 @@ test_expect_success 'load svn dump' "
 
 test_expect_success 'propagate merge information' '
 	git config svn.pushmergeinfo yes &&
-	git checkout svnb1 &&
-	git merge --no-ff svnb2 &&
+	git checkout origin/svnb1 &&
+	git merge --no-ff origin/svnb2 &&
 	git svn dcommit
 	'
 
@@ -29,7 +29,7 @@ test_expect_success 'check svn:mergeinfo' '
 	'
 
 test_expect_success 'merge another branch' '
-	git merge --no-ff svnb3 &&
+	git merge --no-ff origin/svnb3 &&
 	git svn dcommit
 	'
 
@@ -40,7 +40,7 @@ test_expect_success 'check primary parent mergeinfo respected' '
 	'
 
 test_expect_success 'merge existing merge' '
-	git merge --no-ff svnb4 &&
+	git merge --no-ff origin/svnb4 &&
 	git svn dcommit
 	'
 
@@ -53,7 +53,7 @@ test_expect_success "check both parents' mergeinfo respected" '
 	'
 
 test_expect_success 'make further commits to branch' '
-	git checkout svnb2 &&
+	git checkout origin/svnb2 &&
 	touch newb2file &&
 	git add newb2file &&
 	git commit -m "later b2 commit" &&
@@ -64,8 +64,8 @@ test_expect_success 'make further commits to branch' '
 	'
 
 test_expect_success 'second forward merge' '
-	git checkout svnb1 &&
-	git merge --no-ff svnb2 &&
+	git checkout origin/svnb1 &&
+	git merge --no-ff origin/svnb2 &&
 	git svn dcommit
 	'
 
@@ -78,8 +78,8 @@ test_expect_success 'check new mergeinfo added' '
 	'
 
 test_expect_success 'reintegration merge' '
-	git checkout svnb4 &&
-	git merge --no-ff svnb1 &&
+	git checkout origin/svnb4 &&
+	git merge --no-ff origin/svnb1 &&
 	git svn dcommit
 	'
 
@@ -92,11 +92,11 @@ test_expect_success 'check reintegration mergeinfo' '
 	'
 
 test_expect_success 'dcommit a merge at the top of a stack' '
-	git checkout svnb1 &&
+	git checkout origin/svnb1 &&
 	touch anotherfile &&
 	git add anotherfile &&
 	git commit -m "a commit" &&
-	git merge svnb4 &&
+	git merge origin/svnb4 &&
 	git svn dcommit
 	'
 
diff --git a/t/t9163-git-svn-reset-clears-caches.sh b/t/t9163-git-svn-reset-clears-caches.sh
index cd4c662..d6245ce 100755
--- a/t/t9163-git-svn-reset-clears-caches.sh
+++ b/t/t9163-git-svn-reset-clears-caches.sh
@@ -70,9 +70,9 @@ test_expect_success 'rebase looses SVN merge (m)' '
 #
 test_expect_success 'reset and fetch gets the SVN merge (m) correctly' '
 	git svn reset -r 3 &&
-	git reset --hard trunk &&
+	git reset --hard origin/trunk &&
 	git svn fetch &&
-	test 2 = $(git cat-file -p trunk|grep parent|wc -l)
+	test 2 = $(git cat-file -p origin/trunk|grep parent|wc -l)
 '
 
 test_done
diff --git a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh
index 13ae7e3..fa3ef3b 100755
--- a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh
+++ b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh
@@ -53,7 +53,7 @@ test_expect_success 'clone svn repo' '
 '
 
 test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&
-	y=$(git rev-parse branch2) &&
+	y=$(git rev-parse origin/branch2) &&
 	test "x$x" = "x$y"
 '
 
diff --git a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh
index af0ec0e..52f2e46 100755
--- a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh
+++ b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh
@@ -46,7 +46,7 @@ test_expect_success 'clone svn repo' '
 '
 
 test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&
-	y=$(git rev-parse branch2) &&
+	y=$(git rev-parse origin/branch2) &&
 	test "x$x" = "x$y"
 '
 
diff --git a/t/t9167-git-svn-cmd-branch-subproject.sh b/t/t9167-git-svn-cmd-branch-subproject.sh
index 53def87..ba35fc0 100755
--- a/t/t9167-git-svn-cmd-branch-subproject.sh
+++ b/t/t9167-git-svn-cmd-branch-subproject.sh
@@ -31,7 +31,7 @@ test_expect_success 'import into git' '
 	git svn init --trunk=trunk/project --branches=branches/*/project \
 		--tags=tags/*/project "$svnrepo" &&
 	git svn fetch &&
-	git checkout remotes/trunk
+	git checkout remotes/origin/trunk
 '
 
 test_expect_success 'git svn branch tests' '
-- 
1.8.4.653.g2df02b3

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [RFC/PATCHv3 2/3] git-svn: Warn about changing default for --prefix in Git v2.0
  2013-10-11 12:57               ` [RFC/PATCHv3 2/3] git-svn: Warn about changing default for --prefix in Git v2.0 Johan Herland
@ 2013-10-12 22:33                 ` Eric Wong
  0 siblings, 0 replies; 23+ messages in thread
From: Eric Wong @ 2013-10-12 22:33 UTC (permalink / raw)
  To: Johan Herland; +Cc: git, tfnico

Johan Herland <johan@herland.net> wrote:
> In Git v2.0, we will change the default --prefix for init/clone from
> none/empty to "origin/" (which causes SVN-tracking branches to be
> placed at refs/remotes/origin/* instead of refs/remotes/*).
> 
> This patch warns users about the upcoming change, both in the git-svn
> manual page, and on stderr when running init/clone in the "multi-mode"
> without providing a --prefix.
> 
> Cc: Eric Wong <normalperson@yhbt.net>
> Signed-off-by: Johan Herland <johan@herland.net>

Thanks!

1/2 and 2/3 signed-off and pushed to git://git.bogomips.org/git-svn.git

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [RFC/PATCHv3 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given
  2013-10-11 12:57               ` [RFC/PATCHv3 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given Johan Herland
@ 2014-04-19  8:32                 ` Eric Wong
  2014-04-19  9:10                   ` [PATCH] git-svn.txt: Retain a description og pre-v2.0 default prefix Johan Herland
  0 siblings, 1 reply; 23+ messages in thread
From: Eric Wong @ 2014-04-19  8:32 UTC (permalink / raw)
  To: Johan Herland; +Cc: git, tfnico, Junio C Hamano

Johan Herland <johan@herland.net> wrote:
> --- a/Documentation/git-svn.txt
> +++ b/Documentation/git-svn.txt
> @@ -86,14 +86,7 @@ COMMANDS
>  	(refs/remotes/$remote/*). Setting a prefix is also useful
>  	if you wish to track multiple projects that share a common
>  	repository.
> -+
> -NOTE: In Git v2.0, the default prefix will CHANGE from "" (no prefix)
> -to "origin/". This is done to put SVN-tracking refs at
> -"refs/remotes/origin/*" instead of "refs/remotes/*", and make them
> -more compatible with how Git's own remote-tracking refs are organized
> -(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,
> -by using the --prefix option.
> -
> +	By default, the prefix is set to 'origin/'.

We should maintain a description of <=1.9 behavior in the manpage.
Users on long-term-support systems are likely to continue using ancient
git installations for some time (5-10 years, even?), but may come across
the current documentation online.

Otherwise the patch looks fine and I can push it up for Junio for
2.0-rc1.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] git-svn.txt: Retain a description og pre-v2.0 default prefix
  2014-04-19  8:32                 ` Eric Wong
@ 2014-04-19  9:10                   ` Johan Herland
  2014-04-19 11:43                     ` Eric Wong
  0 siblings, 1 reply; 23+ messages in thread
From: Johan Herland @ 2014-04-19  9:10 UTC (permalink / raw)
  To: Eric Wong; +Cc: git, Junio C Hamano, tfnico, Johan Herland

Add a description of <=1.9 behavior in the manpage. Users on
long-term-support systems are likely to continue using ancient
git installations for some time (5-10 years, even?), but may
come across the current documentation online.

Suggested-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
---

> We should maintain a description of <=1.9 behavior in the manpage.
> Users on long-term-support systems are likely to continue using ancient
> git installations for some time (5-10 years, even?), but may come across
> the current documentation online.

Feel free to add/squash this on top.

> Otherwise the patch looks fine and I can push it up for Junio for
> 2.0-rc1.

Thanks!

...Johan

 Documentation/git-svn.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 3a7dd80..5b3c38d 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -87,6 +87,11 @@ COMMANDS
 	if you wish to track multiple projects that share a common
 	repository.
 	By default, the prefix is set to 'origin/'.
++
+NOTE: Before Git v2.0, the default prefix was "" (no prefix). This
+meant that SVN-tracking refs were put at "refs/remotes/*", which is
+incompatible with how Git's own remote-tracking refs are organized.
+
 --ignore-paths=<regex>;;
 	When passed to 'init' or 'clone' this regular expression will
 	be preserved as a config key.  See 'fetch' for a description
-- 
1.9.1.587.g6ba9303

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH] git-svn.txt: Retain a description og pre-v2.0 default prefix
  2014-04-19  9:10                   ` [PATCH] git-svn.txt: Retain a description og pre-v2.0 default prefix Johan Herland
@ 2014-04-19 11:43                     ` Eric Wong
  0 siblings, 0 replies; 23+ messages in thread
From: Eric Wong @ 2014-04-19 11:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, tfnico, Johan Herland

Johan Herland <johan@herland.net> wrote:
> Feel free to add/squash this on top.

Thanks!  Squashed and pushed.

The following changes since commit cc291953df19aa4a97bee3590e708dc1fc557500:

  Git 2.0-rc0 (2014-04-18 11:21:43 -0700)

are available in the git repository at:

  git://bogomips.org/git-svn.git master

for you to fetch changes up to fe191fcaa58cb785c804465a0da9bcba9fd9e822:

  Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given (2014-04-19 11:30:13 +0000)

----------------------------------------------------------------
Johan Herland (1):
      Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given

 Documentation/git-svn.txt                        | 20 ++-------
 git-svn.perl                                     | 12 +-----
 t/t9107-git-svn-migrate.sh                       | 54 ++++++++++++------------
 t/t9114-git-svn-dcommit-merge.sh                 |  4 +-
 t/t9116-git-svn-log.sh                           | 46 ++++++++++----------
 t/t9117-git-svn-init-clone.sh                    | 16 +++----
 t/t9118-git-svn-funky-branch-names.sh            | 20 ++++-----
 t/t9120-git-svn-clone-with-percent-escapes.sh    | 14 +++---
 t/t9125-git-svn-multi-glob-branch-names.sh       |  6 +--
 t/t9128-git-svn-cmd-branch.sh                    | 18 ++++----
 t/t9135-git-svn-moved-branch-empty-file.sh       |  2 +-
 t/t9141-git-svn-multiple-branches.sh             | 28 ++++++------
 t/t9145-git-svn-master-branch.sh                 |  2 +-
 t/t9155-git-svn-fetch-deleted-tag.sh             |  4 +-
 t/t9156-git-svn-fetch-deleted-tag-2.sh           |  6 +--
 t/t9161-git-svn-mergeinfo-push.sh                | 22 +++++-----
 t/t9163-git-svn-reset-clears-caches.sh           |  4 +-
 t/t9165-git-svn-fetch-merge-branch-of-branch.sh  |  2 +-
 t/t9166-git-svn-fetch-merge-branch-of-branch2.sh |  2 +-
 t/t9167-git-svn-cmd-branch-subproject.sh         |  2 +-
 20 files changed, 131 insertions(+), 153 deletions(-)

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-04-19 11:43 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-22  9:02 git-svn: Use prefix by default? Thomas Ferris Nicolaisen
2013-09-30 22:39 ` Johan Herland
2013-09-30 22:46   ` [RFC/PATCH] git svn: Set default --prefix='origin/' if --prefix is not given Johan Herland
2013-10-01  4:07     ` Eric Wong
2013-10-01  6:12       ` Johan Herland
2013-10-03 19:01         ` Eric Wong
2013-10-05 23:30           ` [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Johan Herland
2013-10-05 23:30             ` [RFC/PATCHv2 2/3] git-svn: Warn about changing default for --prefix in Git v2.0 Johan Herland
2013-10-09  1:34               ` Eric Sunshine
2013-10-09 12:18                 ` Johan Herland
2013-10-05 23:30             ` [RFC/PATCHv2 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given Johan Herland
2013-10-06  9:51             ` [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Philip Oakley
2013-10-06 13:46               ` Johan Herland
2013-10-09  1:33             ` Eric Sunshine
2013-10-09 12:06               ` Johan Herland
2013-10-11 12:57             ` [RFC/PATCHv3 0/3] Change git-svn's default --prefix in Git v2.0 Johan Herland
2013-10-11 12:57               ` [RFC/PATCHv3 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples Johan Herland
2013-10-11 12:57               ` [RFC/PATCHv3 2/3] git-svn: Warn about changing default for --prefix in Git v2.0 Johan Herland
2013-10-12 22:33                 ` Eric Wong
2013-10-11 12:57               ` [RFC/PATCHv3 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given Johan Herland
2014-04-19  8:32                 ` Eric Wong
2014-04-19  9:10                   ` [PATCH] git-svn.txt: Retain a description og pre-v2.0 default prefix Johan Herland
2014-04-19 11:43                     ` Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).