{"thread":{"id":"34745","subject":"git-svn: Use prefix by default?","startedAt":"2013-08-22T09:02:05Z","lastAt":"2014-04-19T11:43:18Z","messageCount":23,"participants":["Thomas Ferris Nicolaisen","Johan Herland","Eric Wong","Philip Oakley","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"225672","messageId":"CAEcj5uVRcXF+XADFvy_q2mbQOdWPZkz57q1vePOqroMbQw4+HA@mail.gmail.com","threadId":"34745","inReplyTo":null,"subject":"git-svn: Use prefix by default?","fromName":"Thomas Ferris Nicolaisen","fromEmail":"tfnico@gmail.com","sentAt":"2013-08-22T09:02:05Z","receivedAt":"2013-08-22T09:02:05Z","isPatch":false,"sender":{"key":"tfnico@gmail.com","avatar":"https://gravatar.com/avatar/628cf28a25ca4c596c7284562100f70f0ef908bcbfadd4da1eb3d48c23658d01?d=mp&s=160"},"body":"I've recently been forced back into using git-svn, and while I was at\nit, I noticed that git-svn generally behaves a lot better when it is\ninitialized using the --prefix option.\n\nFor example, I make a standard-layout svn clone:\n\n$ git svn clone -s https://svn.company.com/repos/project-foo/\n\n.. and end up with this .gitconfig:\n\n[svn-remote \"svn\"]\n        url = https://svn.company.com/repos/\n        fetch = project-foo/trunk:refs/remotes/trunk\n        branches = project-foo/branches/*:refs/remotes/*\n        tags = project-foo/tags/*:refs/remotes/tags/*\n\nAnd my remote branches looks like this:\n    remotes/trunk\n    remotes/feat-bar\n\nNow, let's say I want to work on the feat-bar branch, so I attempt to\ncreate a tracking branch by the same name:\n\n$ git checkout feat-bar  # will detach head\n$ git checkout remotes/feat-bar  # will detach head\n$ git checkout -t remotes/feat-bar # fatal: Missing branch name; try -b\n$ git checkout -tb remotes/feat-bar # Branch remotes/feat-bar set up\nto track local branch master.\n\nWell, that's not what I wanted.. So I end up doing it the good\nold-fashioned way:\n\n$ git checkout -tb feat-bar remotes/feat-bar # works\n\nNow I am up and rolling, but I get this warning with every checkout or rebase:\n\n     warning: refname 'feat-bar' is ambiguous.\n\nSo, let's see what happens when I create the svn clone using a\n--prefix=mirror/ instead. Here's the config:\n\n[svn-remote \"svn\"]\n        url = https://svn.company.com/repos/\n        fetch = project-foo/trunk:refs/remotes/mirror/trunk\n        branches = project-foo/branches/*:refs/remotes/mirror/*\n        tags = project-foo/tags/*:refs/remotes/mirror/tags/*\n\nHere are my remote branches:\n     remotes/mirror/trunk\n     remotes/mirror/feat-bar\n\nLet's create the tracking branch:\n\n$ git checkout feat-bar  # Branch feat-bar set up to track remote\nbranch feat-bar from mirror.\n\nVoila, worked on the first try. And no more warnings about ambiguous refnames.\n\nSo now my question is: If using a prefix is so healthy for git's\nbranch tracking conventions, why doesn't git-svn default to use some\nprefix like 'origin' or something when initializing a git svn clone?\n\nThe examples were made using 1.8.1.2 on OSX by the way.\n"},{"id":"228485","messageId":"CALKQrgeXAtWeTedqkVtcTAUgbsBA9U6rbqUntu_ArmPgL9R3pg@mail.gmail.com","threadId":"34745","inReplyTo":"CAEcj5uVRcXF+XADFvy_q2mbQOdWPZkz57q1vePOqroMbQw4+HA@mail.gmail.com","subject":"Re: git-svn: Use prefix by default?","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-09-30T22:39:16Z","receivedAt":"2013-09-30T22:39:16Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Thu, Aug 22, 2013 at 11:02 AM, Thomas Ferris Nicolaisen\n<tfnico@gmail.com> wrote:\n> I've recently been forced back into using git-svn, and while I was at\n> it, I noticed that git-svn generally behaves a lot better when it is\n> initialized using the --prefix option.\n\nThanks for raising this issue. Although I'm not using git-svn myself,\nI have been aware of how git-svn pollutes the refs/remote/* namespace\nfor a while. In addition to being messy, it causes potential problems\nfor the remote ref namespaces being discussed in other threads.\nThe issue is even recognized by the git-svn author (see e.g.\nhttp://www.mail-archive.com/git@vger.kernel.org/msg26248.html ).\n\nI have some bad news, and some good news for you. Read on...\n\n> For example, I make a standard-layout svn clone:\n>\n> $ git svn clone -s https://svn.company.com/repos/project-foo/\n>\n> .. and end up with this .gitconfig:\n>\n> [svn-remote \"svn\"]\n>         url = https://svn.company.com/repos/\n>         fetch = project-foo/trunk:refs/remotes/trunk\n>         branches = project-foo/branches/*:refs/remotes/*\n>         tags = project-foo/tags/*:refs/remotes/tags/*\n>\n> And my remote branches looks like this:\n>     remotes/trunk\n>     remotes/feat-bar\n>\n> Now, let's say I want to work on the feat-bar branch, so I attempt to\n> create a tracking branch by the same name:\n>\n> $ git checkout feat-bar  # will detach head\n> $ git checkout remotes/feat-bar  # will detach head\n> $ git checkout -t remotes/feat-bar # fatal: Missing branch name; try -b\n> $ git checkout -tb remotes/feat-bar # Branch remotes/feat-bar set up\n> to track local branch master.\n>\n> Well, that's not what I wanted.. So I end up doing it the good\n> old-fashioned way:\n>\n> $ git checkout -tb feat-bar remotes/feat-bar # works\n\nThe bad news is that the upstream relationship you're trying to create\nbetween your local feat-bar and git-svn's remotes/feat-bar is not a\nvalid upstream relationship.\n\nAn upstream relationship in Git is encoded in the branch.foo.remote and\nbranch.foo.merge configuration variables. These specify the name of the\nupstream remote, and which branch at that remote to pull from,\nrespectively. However, in your case, there is no git remote associated\nwith refs/remotes/feat-bar (nor with refs/remotes/mirror/feat-bar which\nyou create below), and hence there is no valid remote name to assign to\nbranch.feat-bar.remote.\n\nPrior to v1.8.3.2 this still sort-of works (as you observe below),\nbecause the code fails to realize the remote is invalid, and falls back\nto setting branch.feat-bar.remote = \".\" (i.e. the current repo). This\nmight seem like an ok practice until you realize that a \"git push\" back\nto that invalid upstream would happily overwrite\nrefs/remotes/(mirror/)feat-bar, and thus break git-svn's internal state.\n\nThis bug was fixed in v1.8.3.2, more specifically 41c21f22 (branch.c:\nValidate tracking branches with refspecs instead of refs/remotes/*),\nand you can read more about the rationale in that commit message.\n\nThe end result for you is that setting up your local feat-bar to track\ngit-svn's feat-bar will no longer be accepted once you upgrade to >=\nv1.8.3.2. The correct way to set up a local feat-bar branch to work on\ntop of git-svn's feat-bar is instead to forgo the upstream relationship\nand simply do \"git checkout -b feat-bar refs/remotes/(mirror/)feat-bar\".\n\n> Now I am up and rolling, but I get this warning with every checkout or rebase:\n>\n>      warning: refname 'feat-bar' is ambiguous.\n>\n> So, let's see what happens when I create the svn clone using a\n> --prefix=mirror/ instead. Here's the config:\n>\n> [svn-remote \"svn\"]\n>         url = https://svn.company.com/repos/\n>         fetch = project-foo/trunk:refs/remotes/mirror/trunk\n>         branches = project-foo/branches/*:refs/remotes/mirror/*\n>         tags = project-foo/tags/*:refs/remotes/mirror/tags/*\n>\n> Here are my remote branches:\n>      remotes/mirror/trunk\n>      remotes/mirror/feat-bar\n>\n> Let's create the tracking branch:\n>\n> $ git checkout feat-bar  # Branch feat-bar set up to track remote\n> branch feat-bar from mirror.\n\nAs I explained above, this no longer works in >= v1.8.3.2...\n\n> Voila, worked on the first try. And no more warnings about ambiguous refnames.\n\n...but the warning about ambiguous refnames can and should be fixed,\nby making git-svn's --prefix default to adding an extra level below\nrefs/remotes.\n\n> So now my question is: If using a prefix is so healthy for git's\n> branch tracking conventions, why doesn't git-svn default to use some\n> prefix like 'origin' or something when initializing a git svn clone?\n\nExactly, and the good news is that I finally got around to writing that\npatch, which I'll post in a minute...\n\n\nHope this helps,\n\n...Johan\n\n--\nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"228487","messageId":"1380581194-5269-1-git-send-email-johan@herland.net","threadId":"34745","inReplyTo":"CALKQrgeXAtWeTedqkVtcTAUgbsBA9U6rbqUntu_ArmPgL9R3pg@mail.gmail.com","subject":"[RFC/PATCH] git svn: Set default --prefix='origin/' if --prefix is not given","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-09-30T22:46:34Z","receivedAt":"2013-09-30T22:46:34Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"git-svn by default puts its Subversion-tracking refs directly in\nrefs/remotes/*. This runs counter to Git's convention of using\nrefs/remotes/$remote/* for storing remote-tracking branches.\n\nFurthermore, combining git-svn with regular git remotes run the risk of\nclobbering refs under refs/remotes (e.g. if you have a git remote\ncalled \"tags\" with a \"v1\" branch, it will overlap with the git-svn's\ntracking branch for the \"v1\" tag from Subversion.\n\nEven though the git-svn refs stored in refs/remotes/* are not \"proper\"\nremote-tracking branches (since they are not covered by a proper git\nremote's refspec), they clearly represent a similar concept, and would\nbenefit from following the same convention.\n\nFor example, if git-svn tracks Subversion branch \"foo\" at\nrefs/remotes/foo, and you create a local branch refs/heads/foo to add\nsome commits to be pushed back to Subversion (using \"git svn dcommit),\nthen it is clearly unhelpful of Git to throw\n\n  warning: refname 'foo' is ambiguous.\n\nevery time you checkout, rebase, or otherwise interact with the branch.\n\nThe existing workaround for this is to supply the --prefix=quux/ to\ngit svn init/clone, so that git-svn's tracking branches end up in\nrefs/remotes/quux/* instead of refs/remotes/*. However, git-svn could\nbe a little more proactive and default to a non-empty prefix that\nsaves unsuspecting users from the inconveniences described above.\n\nThis patch will only affect newly created git-svn setups, as the --prefix\nis set up by git svn init (and git svn clone). Existing git-svn setups\nwill continue with their existing (lack of) prefix. Also, if anyone\nsomehow prefers git-svn's old layout can recreate that by explicitly\npassing an empty prefix (--prefix \"\") on the git svn init/clone command\nline.\n\nThe patch changes the default value for --prefix from \"\" to \"origin/\",\nupdates the git-svn manual page, and fixes the fallout in the git-svn\ntestcases.\n\n(Note that this patch might be easier to review using the --word-diff\nand --word-diff-regex=. diff options.)\n\nSuggested-by: Thomas Ferris Nicolaisen <tfnico@gmail.com>\nCc: Eric Wong <normalperson@yhbt.net>\nSigned-off-by: Johan Herland <johan@herland.net>\n---\n Documentation/git-svn.txt                        |  1 +\n git-svn.perl                                     |  2 +-\n t/t9107-git-svn-migrate.sh                       | 54 ++++++++++++------------\n t/t9114-git-svn-dcommit-merge.sh                 |  4 +-\n t/t9116-git-svn-log.sh                           | 46 ++++++++++----------\n t/t9118-git-svn-funky-branch-names.sh            | 20 ++++-----\n t/t9120-git-svn-clone-with-percent-escapes.sh    | 14 +++---\n t/t9125-git-svn-multi-glob-branch-names.sh       |  6 +--\n t/t9128-git-svn-cmd-branch.sh                    | 18 ++++----\n t/t9135-git-svn-moved-branch-empty-file.sh       |  2 +-\n t/t9141-git-svn-multiple-branches.sh             | 28 ++++++------\n t/t9145-git-svn-master-branch.sh                 |  2 +-\n t/t9155-git-svn-fetch-deleted-tag.sh             |  4 +-\n t/t9156-git-svn-fetch-deleted-tag-2.sh           |  6 +--\n t/t9161-git-svn-mergeinfo-push.sh                | 22 +++++-----\n t/t9163-git-svn-reset-clears-caches.sh           |  4 +-\n t/t9165-git-svn-fetch-merge-branch-of-branch.sh  |  2 +-\n t/t9166-git-svn-fetch-merge-branch-of-branch2.sh |  2 +-\n t/t9167-git-svn-cmd-branch-subproject.sh         |  2 +-\n 19 files changed, 120 insertions(+), 119 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 4dd3bcb..17f5803 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -81,6 +81,7 @@ COMMANDS\n \tspecified, the prefix must include a trailing slash.\n \tSetting a prefix is useful if you wish to track multiple\n \tprojects that share a common repository.\n+\tBy default, the prefix is set to 'origin/'.\n --ignore-paths=<regex>;;\n \tWhen passed to 'init' or 'clone' this regular expression will\n \tbe preserved as a config key.  See 'fetch' for a description\ndiff --git a/git-svn.perl b/git-svn.perl\nindex ff1ce3d..ad3fe66 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1389,7 +1389,7 @@ sub cmd_multi_init {\n \t\tusage(1);\n \t}\n \n-\t$_prefix = '' unless defined $_prefix;\n+\t$_prefix = 'origin/' unless defined $_prefix;\n \tif (defined $url) {\n \t\t$url = canonicalize_url($url);\n \t\tinit_subdir(@_);\ndiff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh\nindex ee73013..6e69fc4 100755\n--- a/t/t9107-git-svn-migrate.sh\n+++ b/t/t9107-git-svn-migrate.sh\n@@ -45,27 +45,27 @@ test_expect_success 'initialize old-style (v0) git svn layout' '\n test_expect_success 'initialize a multi-repository repo' '\n \tgit svn init \"$svnrepo\" -T trunk -t tags -b branches &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n-\tgrep \"^trunk:refs/remotes/trunk$\" fetch.out &&\n+\tgrep \"^trunk:refs/remotes/origin/trunk$\" fetch.out &&\n \ttest -n \"`git config --get svn-remote.svn.branches \\\n-\t            \"^branches/\\*:refs/remotes/\\*$\"`\" &&\n+\t            \"^branches/\\*:refs/remotes/origin/\\*$\"`\" &&\n \ttest -n \"`git config --get svn-remote.svn.tags \\\n-\t            \"^tags/\\*:refs/remotes/tags/\\*$\"`\" &&\n+\t            \"^tags/\\*:refs/remotes/origin/tags/\\*$\"`\" &&\n \tgit config --unset svn-remote.svn.branches \\\n-\t                        \"^branches/\\*:refs/remotes/\\*$\" &&\n+\t                        \"^branches/\\*:refs/remotes/origin/\\*$\" &&\n \tgit config --unset svn-remote.svn.tags \\\n-\t                        \"^tags/\\*:refs/remotes/tags/\\*$\" &&\n-\tgit config --add svn-remote.svn.fetch \"branches/a:refs/remotes/a\" &&\n-\tgit config --add svn-remote.svn.fetch \"branches/b:refs/remotes/b\" &&\n+\t                        \"^tags/\\*:refs/remotes/origin/tags/\\*$\" &&\n+\tgit config --add svn-remote.svn.fetch \"branches/a:refs/remotes/origin/a\" &&\n+\tgit config --add svn-remote.svn.fetch \"branches/b:refs/remotes/origin/b\" &&\n \tfor i in tags/0.1 tags/0.2 tags/0.3; do\n \t\tgit config --add svn-remote.svn.fetch \\\n-\t\t                 $i:refs/remotes/$i || exit 1; done &&\n+\t\t                 $i:refs/remotes/origin/$i || exit 1; done &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n-\tgrep \"^trunk:refs/remotes/trunk$\" fetch.out &&\n-\tgrep \"^branches/a:refs/remotes/a$\" fetch.out &&\n-\tgrep \"^branches/b:refs/remotes/b$\" fetch.out &&\n-\tgrep \"^tags/0\\.1:refs/remotes/tags/0\\.1$\" fetch.out &&\n-\tgrep \"^tags/0\\.2:refs/remotes/tags/0\\.2$\" fetch.out &&\n-\tgrep \"^tags/0\\.3:refs/remotes/tags/0\\.3$\" fetch.out &&\n+\tgrep \"^trunk:refs/remotes/origin/trunk$\" fetch.out &&\n+\tgrep \"^branches/a:refs/remotes/origin/a$\" fetch.out &&\n+\tgrep \"^branches/b:refs/remotes/origin/b$\" fetch.out &&\n+\tgrep \"^tags/0\\.1:refs/remotes/origin/tags/0\\.1$\" fetch.out &&\n+\tgrep \"^tags/0\\.2:refs/remotes/origin/tags/0\\.2$\" fetch.out &&\n+\tgrep \"^tags/0\\.3:refs/remotes/origin/tags/0\\.3$\" fetch.out &&\n \tgrep \"^:refs/${remotes_git_svn}\" fetch.out\n \t'\n \n@@ -73,14 +73,14 @@ test_expect_success 'initialize a multi-repository repo' '\n test_expect_success 'multi-fetch works on partial urls + paths' \"\n \tgit svn multi-fetch &&\n \tfor i in trunk a b tags/0.1 tags/0.2 tags/0.3; do\n-\t\tgit rev-parse --verify refs/remotes/\\$i^0 >> refs.out || exit 1;\n+\t\tgit rev-parse --verify refs/remotes/origin/\\$i^0 >> refs.out || exit 1;\n \t    done &&\n \ttest -z \\\"\\`sort < refs.out | uniq -d\\`\\\" &&\n \tfor i in trunk a b tags/0.1 tags/0.2 tags/0.3; do\n \t  for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do\n \t\tif test \\$j != \\$i; then continue; fi\n-\t    test -z \\\"\\`git diff refs/remotes/\\$i \\\n-\t                         refs/remotes/\\$j\\`\\\" ||exit 1; done; done\n+\t    test -z \\\"\\`git diff refs/remotes/origin/\\$i \\\n+\t                         refs/remotes/origin/\\$j\\`\\\" ||exit 1; done; done\n \t\"\n \n test_expect_success 'migrate --minimize on old inited layout' '\n@@ -98,27 +98,27 @@ test_expect_success 'migrate --minimize on old inited layout' '\n \tgit svn migrate --minimize &&\n \ttest -z \"`git config -l | grep \"^svn-remote\\.git-svn\\.\"`\" &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n-\tgrep \"^trunk:refs/remotes/trunk$\" fetch.out &&\n-\tgrep \"^branches/a:refs/remotes/a$\" fetch.out &&\n-\tgrep \"^branches/b:refs/remotes/b$\" fetch.out &&\n-\tgrep \"^tags/0\\.1:refs/remotes/tags/0\\.1$\" fetch.out &&\n-\tgrep \"^tags/0\\.2:refs/remotes/tags/0\\.2$\" fetch.out &&\n-\tgrep \"^tags/0\\.3:refs/remotes/tags/0\\.3$\" fetch.out &&\n+\tgrep \"^trunk:refs/remotes/origin/trunk$\" fetch.out &&\n+\tgrep \"^branches/a:refs/remotes/origin/a$\" fetch.out &&\n+\tgrep \"^branches/b:refs/remotes/origin/b$\" fetch.out &&\n+\tgrep \"^tags/0\\.1:refs/remotes/origin/tags/0\\.1$\" fetch.out &&\n+\tgrep \"^tags/0\\.2:refs/remotes/origin/tags/0\\.2$\" fetch.out &&\n+\tgrep \"^tags/0\\.3:refs/remotes/origin/tags/0\\.3$\" fetch.out &&\n \tgrep \"^:refs/${remotes_git_svn}\" fetch.out\n \t'\n \n test_expect_success  \".rev_db auto-converted to .rev_map.UUID\" '\n \tgit svn fetch -i trunk &&\n-\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)\" &&\n-\texpect=\"$(ls \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_map.*)\" &&\n+\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)\" &&\n+\texpect=\"$(ls \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_map.*)\" &&\n \ttest -n \"$expect\" &&\n \trev_db=\"$(echo $expect | sed -e \"s,_map,_db,\")\" &&\n \tconvert_to_rev_db \"$expect\" \"$rev_db\" &&\n \trm -f \"$expect\" &&\n \ttest -f \"$rev_db\" &&\n \tgit svn fetch -i trunk &&\n-\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)\" &&\n-\ttest ! -e \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_db &&\n+\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)\" &&\n+\ttest ! -e \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_db &&\n \ttest -f \"$expect\"\n \t'\n \ndiff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\nindex f524d2f..6f0968a 100755\n--- a/t/t9114-git-svn-dcommit-merge.sh\n+++ b/t/t9114-git-svn-dcommit-merge.sh\n@@ -48,7 +48,7 @@ test_expect_success 'setup svn repository' '\n test_expect_success 'setup git mirror and merge' '\n \tgit svn init \"$svnrepo\" -t tags -T trunk -b branches &&\n \tgit svn fetch &&\n-\tgit checkout -b svn remotes/trunk &&\n+\tgit checkout -b svn remotes/origin/trunk &&\n \tgit checkout -b merge &&\n \techo new file > new_file &&\n \tgit add new_file &&\n@@ -81,7 +81,7 @@ test_debug 'gitk --all & sleep 1'\n \n test_expect_success 'verify post-merge ancestry' \"\n \ttest x\\`git rev-parse --verify refs/heads/svn\\` = \\\n-\t     x\\`git rev-parse --verify refs/remotes/trunk \\` &&\n+\t     x\\`git rev-parse --verify refs/remotes/origin/trunk \\` &&\n \ttest x\\`git rev-parse --verify refs/heads/svn^2\\` = \\\n \t     x\\`git rev-parse --verify refs/heads/merge\\` &&\n \tgit cat-file commit refs/heads/svn^ | grep '^friend$'\ndiff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh\nindex cf4c052..45773ee 100755\n--- a/t/t9116-git-svn-log.sh\n+++ b/t/t9116-git-svn-log.sh\n@@ -20,20 +20,20 @@ test_expect_success 'setup repository and import' '\n \t) &&\n \tgit svn init \"$svnrepo\" -T trunk -b branches -t tags &&\n \tgit svn fetch &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \techo bye >> README &&\n \tgit commit -a -m bye &&\n \tgit svn dcommit &&\n-\tgit reset --hard a &&\n+\tgit reset --hard origin/a &&\n \techo why >> FEEDME &&\n \tgit update-index --add FEEDME &&\n \tgit commit -m feedme &&\n \tgit svn dcommit &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \techo aye >> README &&\n \tgit commit -a -m aye &&\n \tgit svn dcommit &&\n-\tgit reset --hard b &&\n+\tgit reset --hard origin/b &&\n \techo spy >> README &&\n \tgit commit -a -m spy &&\n \techo try >> README &&\n@@ -42,26 +42,26 @@ test_expect_success 'setup repository and import' '\n \t'\n \n test_expect_success 'run log' \"\n-\tgit reset --hard a &&\n-\tgit svn log -r2 trunk | grep ^r2 &&\n-\tgit svn log -r4 trunk | grep ^r4 &&\n+\tgit reset --hard origin/a &&\n+\tgit svn log -r2 origin/trunk | grep ^r2 &&\n+\tgit svn log -r4 origin/trunk | grep ^r4 &&\n \tgit svn log -r3 | grep ^r3\n \t\"\n \n test_expect_success 'run log against a from trunk' \"\n-\tgit reset --hard trunk &&\n-\tgit svn log -r3 a | grep ^r3\n+\tgit reset --hard origin/trunk &&\n+\tgit svn log -r3 origin/a | grep ^r3\n \t\"\n \n printf 'r1 \\nr2 \\nr4 \\n' > expected-range-r1-r2-r4\n \n test_expect_success 'test ascending revision range' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -\n \t\"\n \n test_expect_success 'test ascending revision range with --show-commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -\n \t\"\n \n@@ -69,7 +69,7 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' \"\n \tgit svn find-rev r1 >expected-range-r1-r2-r4-sha1 &&\n \tgit svn find-rev r2 >>expected-range-r1-r2-r4-sha1 &&\n \tgit svn find-rev r4 >>expected-range-r1-r2-r4-sha1 &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f2 >out &&\n \tgit rev-parse \\$(cat out) >actual &&\n \ttest_cmp expected-range-r1-r2-r4-sha1 actual\n@@ -78,67 +78,67 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' \"\n printf 'r4 \\nr2 \\nr1 \\n' > expected-range-r4-r2-r1\n \n test_expect_success 'test descending revision range' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 4:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4-r2-r1 -\n \t\"\n \n printf 'r1 \\nr2 \\n' > expected-range-r1-r2\n \n test_expect_success 'test ascending revision range with unreachable revision' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 1:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2 -\n \t\"\n \n printf 'r2 \\nr1 \\n' > expected-range-r2-r1\n \n test_expect_success 'test descending revision range with unreachable revision' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2-r1 -\n \t\"\n \n printf 'r2 \\n' > expected-range-r2\n \n test_expect_success 'test ascending revision range with unreachable upper boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 2:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable upper boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:2 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -\n \t\"\n \n printf 'r4 \\n' > expected-range-r4\n \n test_expect_success 'test ascending revision range with unreachable lower boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable lower boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 4:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \n printf -- '------------------------------------------------------------------------\\n' > expected-separator\n \n test_expect_success 'test ascending revision range with unreachable boundary revisions and no commits' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 5:6 | test_cmp expected-separator -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable boundary revisions and no commits' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 6:5 | test_cmp expected-separator -\n \t\"\n \n test_expect_success 'test ascending revision range with unreachable boundary revisions and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:5 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable boundary revisions and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 5:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \ndiff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh\nindex 15f93b4..ed4d136 100755\n--- a/t/t9118-git-svn-funky-branch-names.sh\n+++ b/t/t9118-git-svn-funky-branch-names.sh\n@@ -41,20 +41,20 @@ test_expect_success 'test clone with funky branch names' '\n \tgit svn clone -s \"$svnrepo/pr ject\" project &&\n \t(\n \t\tcd project &&\n-\t\tgit rev-parse \"refs/remotes/fun%20plugin\" &&\n-\t\tgit rev-parse \"refs/remotes/more%20fun%20plugin!\" &&\n-\t\tgit rev-parse \"refs/remotes/$scary_ref\" &&\n-\t\tgit rev-parse \"refs/remotes/%2Eleading_dot\" &&\n-\t\tgit rev-parse \"refs/remotes/trailing_dot%2E\" &&\n-\t\tgit rev-parse \"refs/remotes/trailing_dotlock%2Elock\" &&\n-\t\tgit rev-parse \"refs/remotes/$non_reflog\"\n+\t\tgit rev-parse \"refs/remotes/origin/fun%20plugin\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/more%20fun%20plugin!\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/$scary_ref\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/%2Eleading_dot\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/trailing_dot%2E\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/trailing_dotlock%2Elock\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/$non_reflog\"\n \t)\n \t'\n \n test_expect_success 'test dcommit to funky branch' \"\n \t(\n \t\tcd project &&\n-\t\tgit reset --hard 'refs/remotes/more%20fun%20plugin!' &&\n+\t\tgit reset --hard 'refs/remotes/origin/more%20fun%20plugin!' &&\n \t\techo hello >> foo &&\n \t\tgit commit -m 'hello' -- foo &&\n \t\tgit svn dcommit\n@@ -64,7 +64,7 @@ test_expect_success 'test dcommit to funky branch' \"\n test_expect_success 'test dcommit to scary branch' '\n \t(\n \t\tcd project &&\n-\t\tgit reset --hard \"refs/remotes/$scary_ref\" &&\n+\t\tgit reset --hard \"refs/remotes/origin/$scary_ref\" &&\n \t\techo urls are scary >> foo &&\n \t\tgit commit -m \"eep\" -- foo &&\n \t\tgit svn dcommit\n@@ -74,7 +74,7 @@ test_expect_success 'test dcommit to scary branch' '\n test_expect_success 'test dcommit to trailing_dotlock branch' '\n \t(\n \t\tcd project &&\n-\t\tgit reset --hard \"refs/remotes/trailing_dotlock%2Elock\" &&\n+\t\tgit reset --hard \"refs/remotes/origin/trailing_dotlock%2Elock\" &&\n \t\techo who names branches like this anyway? >> foo &&\n \t\tgit commit -m \"bar\" -- foo &&\n \t\tgit svn dcommit\ndiff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh\nindex 1d92c05..1c84ce1 100755\n--- a/t/t9120-git-svn-clone-with-percent-escapes.sh\n+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh\n@@ -58,19 +58,19 @@ test_expect_success 'test clone --stdlayout with percent escapes' '\n \tgit svn clone --stdlayout \"$svnrepo/pr%20ject\" percent &&\n \t(\n \t\tcd percent &&\n-\t\tgit rev-parse refs/remotes/trunk^0 &&\n-\t\tgit rev-parse refs/remotes/b^0 &&\n-\t\tgit rev-parse refs/remotes/tags/v1^0\n+\t\tgit rev-parse refs/remotes/origin/trunk^0 &&\n+\t\tgit rev-parse refs/remotes/origin/b^0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v1^0\n \t)\n '\n \n test_expect_success 'test clone -s with unescaped space' '\n-\tgit svn clone -s \"$svnrepo/pr ject\" space &&\n+\tgit svn clone -s \"$svnrepo/pr ject\" --prefix origin/ space &&\n \t(\n \t\tcd space &&\n-\t\tgit rev-parse refs/remotes/trunk^0 &&\n-\t\tgit rev-parse refs/remotes/b^0 &&\n-\t\tgit rev-parse refs/remotes/tags/v1^0\n+\t\tgit rev-parse refs/remotes/origin/trunk^0 &&\n+\t\tgit rev-parse refs/remotes/origin/b^0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v1^0\n \t)\n '\n \ndiff --git a/t/t9125-git-svn-multi-glob-branch-names.sh b/t/t9125-git-svn-multi-glob-branch-names.sh\nindex 096abd1..0d53fc9 100755\n--- a/t/t9125-git-svn-multi-glob-branch-names.sh\n+++ b/t/t9125-git-svn-multi-glob-branch-names.sh\n@@ -20,14 +20,14 @@ test_expect_success 'test clone with multi-glob in branch names' '\n \tgit svn clone -T trunk -b branches/*/* -t tags \\\n \t              \"$svnrepo/project\" project &&\n \t(cd project &&\n-\t\tgit rev-parse \"refs/remotes/v14.1/beta\" &&\n-\t\tgit rev-parse \"refs/remotes/v14.1/gold\"\n+\t\tgit rev-parse \"refs/remotes/origin/v14.1/beta\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/v14.1/gold\"\n \t)\n \t'\n \n test_expect_success 'test dcommit to multi-globbed branch' \"\n \t(cd project &&\n-\tgit reset --hard 'refs/remotes/v14.1/gold' &&\n+\tgit reset --hard 'refs/remotes/origin/v14.1/gold' &&\n \techo hello >> foo &&\n \tgit commit -m 'hello' -- foo &&\n \tgit svn dcommit\ndiff --git a/t/t9128-git-svn-cmd-branch.sh b/t/t9128-git-svn-cmd-branch.sh\nindex 4b034a6..4e95f79 100755\n--- a/t/t9128-git-svn-cmd-branch.sh\n+++ b/t/t9128-git-svn-cmd-branch.sh\n@@ -29,30 +29,30 @@ test_expect_success 'initialize svnrepo' '\n test_expect_success 'import into git' '\n \tgit svn init --stdlayout \"$svnrepo\" &&\n \tgit svn fetch &&\n-\tgit checkout remotes/trunk\n+\tgit checkout remotes/origin/trunk\n '\n \n test_expect_success 'git svn branch tests' '\n \tgit svn branch a &&\n \tbase=$(git rev-parse HEAD:) &&\n-\ttest $base = $(git rev-parse remotes/a:) &&\n+\ttest $base = $(git rev-parse remotes/origin/a:) &&\n \tgit svn branch -m \"created branch b blah\" b &&\n-\ttest $base = $(git rev-parse remotes/b:) &&\n+\ttest $base = $(git rev-parse remotes/origin/b:) &&\n \ttest_must_fail git branch -m \"no branchname\" &&\n \tgit svn branch -n c &&\n-\ttest_must_fail git rev-parse remotes/c &&\n+\ttest_must_fail git rev-parse remotes/origin/c &&\n \ttest_must_fail git svn branch a &&\n \tgit svn branch -t tag1 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag1:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag1:) &&\n \tgit svn branch --tag tag2 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag2:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag2:) &&\n \tgit svn tag tag3 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag3:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag3:) &&\n \tgit svn tag -m \"created tag4 foo\" tag4 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag4:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag4:) &&\n \ttest_must_fail git svn tag -m \"no tagname\" &&\n \tgit svn tag -n tag5 &&\n-\ttest_must_fail git rev-parse remotes/tags/tag5 &&\n+\ttest_must_fail git rev-parse remotes/origin/tags/tag5 &&\n \ttest_must_fail git svn tag tag1\n '\n \ndiff --git a/t/t9135-git-svn-moved-branch-empty-file.sh b/t/t9135-git-svn-moved-branch-empty-file.sh\nindex 5280e5f..93db45d 100755\n--- a/t/t9135-git-svn-moved-branch-empty-file.sh\n+++ b/t/t9135-git-svn-moved-branch-empty-file.sh\n@@ -12,7 +12,7 @@ test_expect_success 'clone using git svn' 'git svn clone -s \"$svnrepo\" x'\n test_expect_success 'test that b1 exists and is empty' '\n \t(\n \t\tcd x &&\n-\t\tgit reset --hard branch-c &&\n+\t\tgit reset --hard origin/branch-c &&\n \t\ttest -f b1 &&\n \t\t! test -s b1\n \t)\ndiff --git a/t/t9141-git-svn-multiple-branches.sh b/t/t9141-git-svn-multiple-branches.sh\nindex 3cd0671..8e7f7d6 100755\n--- a/t/t9141-git-svn-multiple-branches.sh\n+++ b/t/t9141-git-svn-multiple-branches.sh\n@@ -66,18 +66,18 @@ test_expect_success 'clone multiple branch and tag paths' '\n \t\t      -t tags_A/* --tags tags_B \\\n \t\t      \"$svnrepo/project\" git_project &&\n \t( cd git_project &&\n-\t\tgit rev-parse refs/remotes/first &&\n-\t\tgit rev-parse refs/remotes/second &&\n-\t\tgit rev-parse refs/remotes/1 &&\n-\t\tgit rev-parse refs/remotes/2 &&\n-\t\tgit rev-parse refs/remotes/tags/1.0 &&\n-\t\tgit rev-parse refs/remotes/tags/2.0 &&\n-\t\tgit rev-parse refs/remotes/tags/3.0 &&\n-\t\tgit rev-parse refs/remotes/tags/4.0 &&\n-\t\tgit rev-parse refs/remotes/tags/v5 &&\n-\t\tgit rev-parse refs/remotes/tags/v6 &&\n-\t\tgit rev-parse refs/remotes/tags/v7 &&\n-\t\tgit rev-parse refs/remotes/tags/v8\n+\t\tgit rev-parse refs/remotes/origin/first &&\n+\t\tgit rev-parse refs/remotes/origin/second &&\n+\t\tgit rev-parse refs/remotes/origin/1 &&\n+\t\tgit rev-parse refs/remotes/origin/2 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/1.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/2.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/3.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/4.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v5 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v6 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v7 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v8\n \t)\n '\n \n@@ -85,8 +85,8 @@ test_expect_success 'Multiple branch or tag paths require -d' '\n \t( cd git_project &&\n \t\ttest_must_fail git svn branch -m \"No new branch\" Nope &&\n \t\ttest_must_fail git svn tag -m \"No new tag\" Tagless &&\n-\t\ttest_must_fail git rev-parse refs/remotes/Nope &&\n-\t\ttest_must_fail git rev-parse refs/remotes/tags/Tagless\n+\t\ttest_must_fail git rev-parse refs/remotes/origin/Nope &&\n+\t\ttest_must_fail git rev-parse refs/remotes/origin/tags/Tagless\n \t) &&\n \t( cd svn_project &&\n \t\tsvn_cmd up &&\ndiff --git a/t/t9145-git-svn-master-branch.sh b/t/t9145-git-svn-master-branch.sh\nindex 16852d2..6559137 100755\n--- a/t/t9145-git-svn-master-branch.sh\n+++ b/t/t9145-git-svn-master-branch.sh\n@@ -17,7 +17,7 @@ test_expect_success 'git svn clone --stdlayout sets up trunk as master' '\n \tgit svn clone -s \"$svnrepo\" g &&\n \t(\n \t\tcd g &&\n-\t\ttest x`git rev-parse --verify refs/remotes/trunk^0` = \\\n+\t\ttest x`git rev-parse --verify refs/remotes/origin/trunk^0` = \\\n \t\t     x`git rev-parse --verify refs/heads/master^0`\n \t)\n '\ndiff --git a/t/t9155-git-svn-fetch-deleted-tag.sh b/t/t9155-git-svn-fetch-deleted-tag.sh\nindex a486a98..184336f 100755\n--- a/t/t9155-git-svn-fetch-deleted-tag.sh\n+++ b/t/t9155-git-svn-fetch-deleted-tag.sh\n@@ -35,8 +35,8 @@ test_expect_success 'fetch deleted tags from same revision with checksum error'\n \tcd git_project &&\n \tgit svn fetch &&\n \n-\tgit diff --exit-code mybranch:trunk/subdir/file tags/mytag:file &&\n-\tgit diff --exit-code master:subdir/file tags/mytag^:file\n+\tgit diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&\n+\tgit diff --exit-code master:subdir/file origin/tags/mytag^:file\n '\n \n test_done\ndiff --git a/t/t9156-git-svn-fetch-deleted-tag-2.sh b/t/t9156-git-svn-fetch-deleted-tag-2.sh\nindex 5ce7e2f..7a6e33b 100755\n--- a/t/t9156-git-svn-fetch-deleted-tag-2.sh\n+++ b/t/t9156-git-svn-fetch-deleted-tag-2.sh\n@@ -36,9 +36,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro\n \tcd git_project &&\n \tgit svn fetch &&\n \n-\tgit diff --exit-code master:subdir3/file tags/mytag:file &&\n-\tgit diff --exit-code master:subdir2/file tags/mytag^:file &&\n-\tgit diff --exit-code master:subdir1/file tags/mytag^^:file\n+\tgit diff --exit-code master:subdir3/file origin/tags/mytag:file &&\n+\tgit diff --exit-code master:subdir2/file origin/tags/mytag^:file &&\n+\tgit diff --exit-code master:subdir1/file origin/tags/mytag^^:file\n '\n \n test_done\ndiff --git a/t/t9161-git-svn-mergeinfo-push.sh b/t/t9161-git-svn-mergeinfo-push.sh\nindex 1eab701..6cb0909 100755\n--- a/t/t9161-git-svn-mergeinfo-push.sh\n+++ b/t/t9161-git-svn-mergeinfo-push.sh\n@@ -18,8 +18,8 @@ test_expect_success 'load svn dump' \"\n \n test_expect_success 'propagate merge information' '\n \tgit config svn.pushmergeinfo yes &&\n-\tgit checkout svnb1 &&\n-\tgit merge --no-ff svnb2 &&\n+\tgit checkout origin/svnb1 &&\n+\tgit merge --no-ff origin/svnb2 &&\n \tgit svn dcommit\n \t'\n \n@@ -29,7 +29,7 @@ test_expect_success 'check svn:mergeinfo' '\n \t'\n \n test_expect_success 'merge another branch' '\n-\tgit merge --no-ff svnb3 &&\n+\tgit merge --no-ff origin/svnb3 &&\n \tgit svn dcommit\n \t'\n \n@@ -40,7 +40,7 @@ test_expect_success 'check primary parent mergeinfo respected' '\n \t'\n \n test_expect_success 'merge existing merge' '\n-\tgit merge --no-ff svnb4 &&\n+\tgit merge --no-ff origin/svnb4 &&\n \tgit svn dcommit\n \t'\n \n@@ -53,7 +53,7 @@ test_expect_success \"check both parents' mergeinfo respected\" '\n \t'\n \n test_expect_success 'make further commits to branch' '\n-\tgit checkout svnb2 &&\n+\tgit checkout origin/svnb2 &&\n \ttouch newb2file &&\n \tgit add newb2file &&\n \tgit commit -m \"later b2 commit\" &&\n@@ -64,8 +64,8 @@ test_expect_success 'make further commits to branch' '\n \t'\n \n test_expect_success 'second forward merge' '\n-\tgit checkout svnb1 &&\n-\tgit merge --no-ff svnb2 &&\n+\tgit checkout origin/svnb1 &&\n+\tgit merge --no-ff origin/svnb2 &&\n \tgit svn dcommit\n \t'\n \n@@ -78,8 +78,8 @@ test_expect_success 'check new mergeinfo added' '\n \t'\n \n test_expect_success 'reintegration merge' '\n-\tgit checkout svnb4 &&\n-\tgit merge --no-ff svnb1 &&\n+\tgit checkout origin/svnb4 &&\n+\tgit merge --no-ff origin/svnb1 &&\n \tgit svn dcommit\n \t'\n \n@@ -92,11 +92,11 @@ test_expect_success 'check reintegration mergeinfo' '\n \t'\n \n test_expect_success 'dcommit a merge at the top of a stack' '\n-\tgit checkout svnb1 &&\n+\tgit checkout origin/svnb1 &&\n \ttouch anotherfile &&\n \tgit add anotherfile &&\n \tgit commit -m \"a commit\" &&\n-\tgit merge svnb4 &&\n+\tgit merge origin/svnb4 &&\n \tgit svn dcommit\n \t'\n \ndiff --git a/t/t9163-git-svn-reset-clears-caches.sh b/t/t9163-git-svn-reset-clears-caches.sh\nindex cd4c662..d6245ce 100755\n--- a/t/t9163-git-svn-reset-clears-caches.sh\n+++ b/t/t9163-git-svn-reset-clears-caches.sh\n@@ -70,9 +70,9 @@ test_expect_success 'rebase looses SVN merge (m)' '\n #\n test_expect_success 'reset and fetch gets the SVN merge (m) correctly' '\n \tgit svn reset -r 3 &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn fetch &&\n-\ttest 2 = $(git cat-file -p trunk|grep parent|wc -l)\n+\ttest 2 = $(git cat-file -p origin/trunk|grep parent|wc -l)\n '\n \n test_done\ndiff --git a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh\nindex 13ae7e3..fa3ef3b 100755\n--- a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh\n+++ b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh\n@@ -53,7 +53,7 @@ test_expect_success 'clone svn repo' '\n '\n \n test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&\n-\ty=$(git rev-parse branch2) &&\n+\ty=$(git rev-parse origin/branch2) &&\n \ttest \"x$x\" = \"x$y\"\n '\n \ndiff --git a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh\nindex af0ec0e..52f2e46 100755\n--- a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh\n+++ b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh\n@@ -46,7 +46,7 @@ test_expect_success 'clone svn repo' '\n '\n \n test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&\n-\ty=$(git rev-parse branch2) &&\n+\ty=$(git rev-parse origin/branch2) &&\n \ttest \"x$x\" = \"x$y\"\n '\n \ndiff --git a/t/t9167-git-svn-cmd-branch-subproject.sh b/t/t9167-git-svn-cmd-branch-subproject.sh\nindex 53def87..ba35fc0 100755\n--- a/t/t9167-git-svn-cmd-branch-subproject.sh\n+++ b/t/t9167-git-svn-cmd-branch-subproject.sh\n@@ -31,7 +31,7 @@ test_expect_success 'import into git' '\n \tgit svn init --trunk=trunk/project --branches=branches/*/project \\\n \t\t--tags=tags/*/project \"$svnrepo\" &&\n \tgit svn fetch &&\n-\tgit checkout remotes/trunk\n+\tgit checkout remotes/origin/trunk\n '\n \n test_expect_success 'git svn branch tests' '\n-- \n1.8.4.653.g2df02b3\n"},{"id":"228494","messageId":"20131001040752.GA882@dcvr.yhbt.net","threadId":"34745","inReplyTo":"1380581194-5269-1-git-send-email-johan@herland.net","subject":"Re: [RFC/PATCH] git svn: Set default --prefix='origin/' if --prefix is not given","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2013-10-01T04:07:52Z","receivedAt":"2013-10-01T04:07:52Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Johan Herland <johan@herland.net> wrote:\n> git-svn by default puts its Subversion-tracking refs directly in\n> refs/remotes/*. This runs counter to Git's convention of using\n> refs/remotes/$remote/* for storing remote-tracking branches.\n\n> Furthermore, combining git-svn with regular git remotes run the risk of\n> clobbering refs under refs/remotes (e.g. if you have a git remote\n> called \"tags\" with a \"v1\" branch, it will overlap with the git-svn's\n> tracking branch for the \"v1\" tag from Subversion.\n> \n> Even though the git-svn refs stored in refs/remotes/* are not \"proper\"\n> remote-tracking branches (since they are not covered by a proper git\n> remote's refspec), they clearly represent a similar concept, and would\n> benefit from following the same convention.\n\nI regretted my original naming shortly after introducing it (IIRC,\ngit-svn was the first refs/remotes/* user).  However, this risks\nbreaking existing code and 3rd-party docs/tutorials.\n\nHow about we put a big warning of impending change in there for now and\nwait until git 1.9/2.0 to make the actual change?\n\nThanks for bringing this up again!\n"},{"id":"228495","messageId":"CALKQrgf0tBN9ymZ0Yq6iW95dwayhJC1a_9LZBagW6B_hBo5owA@mail.gmail.com","threadId":"34745","inReplyTo":"20131001040752.GA882@dcvr.yhbt.net","subject":"Re: [RFC/PATCH] git svn: Set default --prefix='origin/' if --prefix is not given","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-10-01T06:12:53Z","receivedAt":"2013-10-01T06:12:53Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Tue, Oct 1, 2013 at 6:07 AM, Eric Wong <normalperson@yhbt.net> wrote:\n> Johan Herland <johan@herland.net> wrote:\n>> git-svn by default puts its Subversion-tracking refs directly in\n>> refs/remotes/*. This runs counter to Git's convention of using\n>> refs/remotes/$remote/* for storing remote-tracking branches.\n>\n>> Furthermore, combining git-svn with regular git remotes run the risk of\n>> clobbering refs under refs/remotes (e.g. if you have a git remote\n>> called \"tags\" with a \"v1\" branch, it will overlap with the git-svn's\n>> tracking branch for the \"v1\" tag from Subversion.\n>>\n>> Even though the git-svn refs stored in refs/remotes/* are not \"proper\"\n>> remote-tracking branches (since they are not covered by a proper git\n>> remote's refspec), they clearly represent a similar concept, and would\n>> benefit from following the same convention.\n>\n> I regretted my original naming shortly after introducing it (IIRC,\n> git-svn was the first refs/remotes/* user).  However, this risks\n> breaking existing code and 3rd-party docs/tutorials.\n\nTrue. Although the patch does not affect existing git-svn\nconfigurations, it does affect all future (where the user does not\npass --prefix), and all documentation and scripts that will come to\nwork on those must be adjusted accordingly.\n\n> How about we put a big warning of impending change in there for now and\n> wait until git 1.9/2.0 to make the actual change?\n\nSounds sensible. What should the warning look like, and where should\nit be placed? I'm thinking that if you run git svn init/clone without\n--prefix, there should be a verbose warning explaining (a) the trouble\nyou're likely to encounter when using no prefix, and (b) the upcoming\nchange in default prefix. Obviuosly, there should be a corresponding\nnote in the git-svn manual page. Any other places in git.git that\nwarrants changing? Hopefully this should be sufficient to trigger\ncorresponding adjustments in third-party tools + docs ahead of the\nactual change in 1.9/2.0.\n\n> Thanks for bringing this up again!\n\nThanks for your comments!\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"228539","messageId":"20131003190139.GA8710@dcvr.yhbt.net","threadId":"34745","inReplyTo":"CALKQrgf0tBN9ymZ0Yq6iW95dwayhJC1a_9LZBagW6B_hBo5owA@mail.gmail.com","subject":"Re: [RFC/PATCH] git svn: Set default --prefix='origin/' if --prefix is not given","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2013-10-03T19:01:39Z","receivedAt":"2013-10-03T19:01:39Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Johan Herland <johan@herland.net> wrote:\n> On Tue, Oct 1, 2013 at 6:07 AM, Eric Wong <normalperson@yhbt.net> wrote:\n> > How about we put a big warning of impending change in there for now and\n> > wait until git 1.9/2.0 to make the actual change?\n> \n> Sounds sensible. What should the warning look like, and where should\n> it be placed? I'm thinking that if you run git svn init/clone without\n> --prefix, there should be a verbose warning explaining (a) the trouble\n> you're likely to encounter when using no prefix, and (b) the upcoming\n> change in default prefix. Obviuosly, there should be a corresponding\n> note in the git-svn manual page. Any other places in git.git that\n> warrants changing? Hopefully this should be sufficient to trigger\n> corresponding adjustments in third-party tools + docs ahead of the\n> actual change in 1.9/2.0.\n\nProbably, yes.  I don't remember off the top of my head if there's\nother places, but init/clone should be a good enough start.\n"},{"id":"228573","messageId":"1381015833-696-1-git-send-email-johan@herland.net","threadId":"34745","inReplyTo":"20131003190139.GA8710@dcvr.yhbt.net","subject":"[RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-10-05T23:30:31Z","receivedAt":"2013-10-05T23:30:31Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"Currently, the git-svn defaults to using an empty prefix, which ends\nup placing the SVN-tracking refs directly in refs/remotes/*. This\nplacement runs counter to Git's convention of placing remote-tracking\nbranches in refs/remotes/$remote/*.\n\nFurthermore, combining git-svn with \"regular\" Git remotes run the risk\nof clobbering refs under refs/remotes (e.g. if you have a git remote\ncalled \"tags\" with a \"v1\" branch, it will overlap with the git-svn's\ntracking branch for the \"v1\" tag from Subversion.\n\nEven though the git-svn refs stored in refs/remotes/* are not \"proper\"\nremote-tracking branches (since they are not covered by a proper git\nremote's refspec), they clearly represent a similar concept, and would\nbenefit from following the same convention.\n\nFor example, if git-svn tracks Subversion branch \"foo\" at\nrefs/remotes/foo, and you create a local branch refs/heads/foo to add\nsome commits to be pushed back to Subversion (using \"git svn dcommit),\nthen it is clearly unhelpful of Git to throw\n\n  warning: refname 'foo' is ambiguous.\n\nevery time you checkout, rebase, or otherwise interact with the branch.\n\nAt this time, the user is better off using the --prefix=foo/ (the\ntrailing slash is important) to git svn init/clone, to cause the\nSVN-tracking refs to be placed at refs/remotes/foo/* instead of\nrefs/remotes/*. This patch updates the documentation to encourage\nuse of --prefix.\n\nThis is also in preparation for changing the default value of --prefix\nat some point in the future.\n\nCc: Eric Wong <normalperson@yhbt.net>\nSigned-off-by: Johan Herland <johan@herland.net>\n---\n Documentation/git-svn.txt | 35 +++++++++++++++++++++++++----------\n 1 file changed, 25 insertions(+), 10 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 4dd3bcb..da00671 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -79,8 +79,13 @@ COMMANDS\n \ttrailing slash, so be sure you include one in the\n \targument if that is what you want.  If --branches/-b is\n \tspecified, the prefix must include a trailing slash.\n-\tSetting a prefix is useful if you wish to track multiple\n-\tprojects that share a common repository.\n+\tSetting a prefix (with a trailing slash) is strongly\n+\tencouraged in any case, as your SVN-tracking refs will\n+\tthen be located at \"refs/remotes/$prefix/*\", which is\n+\tcompatible with Git's own remote-tracking ref layout\n+\t(refs/remotes/$remote/*). Setting a prefix is also useful\n+\tif you wish to track multiple projects that share a common\n+\trepository.\n --ignore-paths=<regex>;;\n \tWhen passed to 'init' or 'clone' this regular expression will\n \tbe preserved as a config key.  See 'fetch' for a description\n@@ -804,16 +809,16 @@ Tracking and contributing to an entire Subversion-managed project\n \n ------------------------------------------------------------------------\n # Clone a repo with standard SVN directory layout (like git clone):\n-\tgit svn clone http://svn.example.com/project --stdlayout\n+\tgit svn clone http://svn.example.com/project --stdlayout --prefix svn/\n # Or, if the repo uses a non-standard directory layout:\n-\tgit svn clone http://svn.example.com/project -T tr -b branch -t tag\n+\tgit svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/\n # View all branches and tags you have cloned:\n \tgit branch -r\n # Create a new branch in SVN\n     git svn branch waldo\n # Reset your master to trunk (or any other branch, replacing 'trunk'\n # with the appropriate name):\n-\tgit reset --hard remotes/trunk\n+\tgit reset --hard svn/trunk\n # You may only dcommit to one branch/tag/trunk at a time.  The usage\n # of dcommit/rebase/show-ignore should be the same as above.\n ------------------------------------------------------------------------\n@@ -827,7 +832,7 @@ have each person clone that repository with 'git clone':\n \n ------------------------------------------------------------------------\n # Do the initial import on a server\n-\tssh server \"cd /pub && git svn clone http://svn.example.com/project\n+\tssh server \"cd /pub && git svn clone http://svn.example.com/project [options...]\"\n # Clone locally - make sure the refs/remotes/ space matches the server\n \tmkdir project\n \tcd project\n@@ -840,8 +845,9 @@ have each person clone that repository with 'git clone':\n \tgit config --remove-section remote.origin\n # Create a local branch from one of the branches just fetched\n \tgit checkout -b master FETCH_HEAD\n-# Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)\n-\tgit svn init http://svn.example.com/project\n+# Initialize 'git svn' locally (be sure to use the same URL and\n+# --stdlayout/-T/-b/-t/--prefix options as were used on server)\n+\tgit svn init http://svn.example.com/project [options...]\n # Pull the latest changes from Subversion\n \tgit svn rebase\n ------------------------------------------------------------------------\n@@ -973,6 +979,15 @@ without giving any repository layout options.  If the full history with\n branches and tags is required, the options '--trunk' / '--branches' /\n '--tags' must be used.\n \n+When using the options for describing the repository layout (--trunk,\n+--tags, --branches, --stdlayout), please also specify the --prefix\n+option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be\n+placed at refs/remotes/origin/* rather than the default refs/remotes/*.\n+The former is more compatible with the layout of Git's \"regular\"\n+remote-tracking refs (refs/remotes/$remote/*), and may potentially\n+prevent similarly named SVN branches and Git remotes from clobbering\n+eachother.\n+\n When using multiple --branches or --tags, 'git svn' does not automatically\n handle name collisions (for example, if two branches from different paths have\n the same name, or if a branch and a tag have the same name).  In these cases,\n@@ -1035,8 +1050,8 @@ comma-separated list of names within braces. For example:\n [svn-remote \"huge-project\"]\n \turl = http://server.org/svn\n \tfetch = trunk/src:refs/remotes/trunk\n-\tbranches = branches/{red,green}/src:refs/remotes/branches/*\n-\ttags = tags/{1.0,2.0}/src:refs/remotes/tags/*\n+\tbranches = branches/{red,green}/src:refs/remotes/project-a/branches/*\n+\ttags = tags/{1.0,2.0}/src:refs/remotes/project-a/tags/*\n ------------------------------------------------------------------------\n \n Multiple fetch, branches, and tags keys are supported:\n-- \n1.8.4.653.g2df02b3\n"},{"id":"228572","messageId":"1381015833-696-2-git-send-email-johan@herland.net","threadId":"34745","inReplyTo":"1381015833-696-1-git-send-email-johan@herland.net","subject":"[RFC/PATCHv2 2/3] git-svn: Warn about changing default for --prefix in Git v2.0","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-10-05T23:30:32Z","receivedAt":"2013-10-05T23:30:32Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"In Git v2.0, we will change the default --prefix for init/clone from\nnone/empty to \"origin/\" (which causes SVN-tracking branches to be\nplaced at refs/remotes/origin/* instead of refs/remotes/*).\n\nThis patch warns users about the upcoming change, both in the git-svn\nmanual page, and on stderr when running init/clone in the \"multi-mode\"\nwithout providing a --prefix.\n\nCc: Eric Wong <normalperson@yhbt.net>\nSigned-off-by: Johan Herland <johan@herland.net>\n---\n Documentation/git-svn.txt     | 11 ++++++-\n git-svn.perl                  | 12 +++++++-\n t/t9117-git-svn-init-clone.sh | 67 +++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 88 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex da00671..59e912e 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -86,6 +86,14 @@ COMMANDS\n \t(refs/remotes/$remote/*). Setting a prefix is also useful\n \tif you wish to track multiple projects that share a common\n \trepository.\n++\n+NOTE: In Git v2.0, the default prefix will CHANGE from \"\" (no prefix)\n+to \"origin/\". This is done to put SVN-tracking refs at\n+\"refs/remotes/origin/*\" instead of \"refs/remotes/*\", and make them\n+more compatible with how Git's own remote-tracking refs are organized\n+(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,\n+by using the --prefix option.\n+\n --ignore-paths=<regex>;;\n \tWhen passed to 'init' or 'clone' this regular expression will\n \tbe preserved as a config key.  See 'fetch' for a description\n@@ -986,7 +994,8 @@ placed at refs/remotes/origin/* rather than the default refs/remotes/*.\n The former is more compatible with the layout of Git's \"regular\"\n remote-tracking refs (refs/remotes/$remote/*), and may potentially\n prevent similarly named SVN branches and Git remotes from clobbering\n-eachother.\n+eachother. In Git v2.0 the default prefix used (i.e. when no --prefix\n+is given) will change from \"\" (no prefix) to \"origin/\".\n \n When using multiple --branches or --tags, 'git svn' does not automatically\n handle name collisions (for example, if two branches from different paths have\ndiff --git a/git-svn.perl b/git-svn.perl\nindex ff1ce3d..0443a4f 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1389,7 +1389,17 @@ sub cmd_multi_init {\n \t\tusage(1);\n \t}\n \n-\t$_prefix = '' unless defined $_prefix;\n+\tunless (defined $_prefix) {\n+\t\t$_prefix = '';\n+\t\twarn <<EOF\n+WARNING: --prefix is not given, defaulting to empty prefix.\n+         This is probably not what you want! In order to stay compatible\n+         with regular remote-tracking refs, provide a prefix like\n+         --prefix=origin/ (remember the trailing slash), which will cause\n+         the SVN-tracking refs to be placed at refs/remotes/origin/*.\n+NOTE: In Git v2.0, the default prefix will change from empty to 'origin/'.\n+EOF\n+\t}\n \tif (defined $url) {\n \t\t$url = canonicalize_url($url);\n \t\tinit_subdir(@_);\ndiff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh\nindex b7ef9e2..1c8d049 100755\n--- a/t/t9117-git-svn-init-clone.sh\n+++ b/t/t9117-git-svn-init-clone.sh\n@@ -52,4 +52,71 @@ test_expect_success 'clone to target directory with --stdlayout' '\n \trm -rf target\n \t'\n \n+test_expect_success 'init without -s/-T/-b/-t does not warn' '\n+\ttest ! -d trunk &&\n+\tgit svn init \"$svnrepo\"/project/trunk trunk 2>warning &&\n+\ttest_must_fail grep -q prefix warning &&\n+\trm -rf trunk &&\n+\trm -f warning\n+\t'\n+\n+test_expect_success 'clone without -s/-T/-b/-t does not warn' '\n+\ttest ! -d trunk &&\n+\tgit svn clone \"$svnrepo\"/project/trunk 2>warning &&\n+\ttest_must_fail grep -q prefix warning &&\n+\trm -rf trunk &&\n+\trm -f warning\n+\t'\n+\n+test_svn_configured_prefix () {\n+\tprefix=$1\n+\tcat >expect <<EOF\n+project/trunk:refs/remotes/${prefix}trunk\n+project/branches/*:refs/remotes/${prefix}*\n+project/tags/*:refs/remotes/${prefix}tags/*\n+EOF\n+\ttest ! -f actual &&\n+\tgit --git-dir=project/.git config svn-remote.svn.fetch >>actual &&\n+\tgit --git-dir=project/.git config svn-remote.svn.branches >>actual &&\n+\tgit --git-dir=project/.git config svn-remote.svn.tags >>actual &&\n+\ttest_cmp expect actual &&\n+\trm -f expect actual\n+}\n+\n+test_expect_success 'init with -s/-T/-b/-t without --prefix warns' '\n+\ttest ! -d project &&\n+\tgit svn init -s \"$svnrepo\"/project project 2>warning &&\n+\tgrep -q prefix warning &&\n+\ttest_svn_configured_prefix \"\" &&\n+\trm -rf project &&\n+\trm -f warning\n+\t'\n+\n+test_expect_success 'clone with -s/-T/-b/-t without --prefix warns' '\n+\ttest ! -d project &&\n+\tgit svn clone -s \"$svnrepo\"/project 2>warning &&\n+\tgrep -q prefix warning &&\n+\ttest_svn_configured_prefix \"\" &&\n+\trm -rf project &&\n+\trm -f warning\n+\t'\n+\n+test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '\n+\ttest ! -d project &&\n+\tgit svn init -s \"$svnrepo\"/project project --prefix=\"\" 2>warning &&\n+\ttest_must_fail grep -q prefix warning &&\n+\ttest_svn_configured_prefix \"\" &&\n+\trm -rf project &&\n+\trm -f warning\n+\t'\n+\n+test_expect_success 'clone with -s/-T/-b/-t and --prefix does not warn' '\n+\ttest ! -d project &&\n+\tgit svn clone -s \"$svnrepo\"/project --prefix=\"\" 2>warning &&\n+\ttest_must_fail grep -q prefix warning &&\n+\ttest_svn_configured_prefix \"\" &&\n+\trm -rf project &&\n+\trm -f warning\n+\t'\n+\n test_done\n-- \n1.8.4.653.g2df02b3\n"},{"id":"228574","messageId":"1381015833-696-3-git-send-email-johan@herland.net","threadId":"34745","inReplyTo":"1381015833-696-1-git-send-email-johan@herland.net","subject":"[RFC/PATCHv2 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-10-05T23:30:33Z","receivedAt":"2013-10-05T23:30:33Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"git-svn by default puts its Subversion-tracking refs directly in\nrefs/remotes/*. This runs counter to Git's convention of using\nrefs/remotes/$remote/* for storing remote-tracking branches.\n\nFurthermore, combining git-svn with regular git remotes run the risk of\nclobbering refs under refs/remotes (e.g. if you have a git remote\ncalled \"tags\" with a \"v1\" branch, it will overlap with the git-svn's\ntracking branch for the \"v1\" tag from Subversion.\n\nEven though the git-svn refs stored in refs/remotes/* are not \"proper\"\nremote-tracking branches (since they are not covered by a proper git\nremote's refspec), they clearly represent a similar concept, and would\nbenefit from following the same convention.\n\nFor example, if git-svn tracks Subversion branch \"foo\" at\nrefs/remotes/foo, and you create a local branch refs/heads/foo to add\nsome commits to be pushed back to Subversion (using \"git svn dcommit),\nthen it is clearly unhelpful of Git to throw\n\n  warning: refname 'foo' is ambiguous.\n\nevery time you checkout, rebase, or otherwise interact with the branch.\n\nThe existing workaround for this is to supply the --prefix=quux/ to\ngit svn init/clone, so that git-svn's tracking branches end up in\nrefs/remotes/quux/* instead of refs/remotes/*. However, encouraging\nusers to specify --prefix to work around a design flaw in git-svn is\nsuboptimal, and not a long term solution to the problem. Instead,\ngit-svn should default to use a non-empty prefix that saves\nunsuspecting users from the inconveniences described above.\n\nThis patch will only affect newly created git-svn setups, as the\n--prefix option only applies to git svn init (and git svn clone).\nExisting git-svn setups will continue with their existing (lack of)\nprefix. Also, if anyone somehow prefers git-svn's old layout, they\ncan recreate that by explicitly passing an empty prefix (--prefix \"\")\non the git svn init/clone command line.\n\nThe patch changes the default value for --prefix from \"\" to \"origin/\",\nupdates the git-svn manual page, and fixes the fallout in the git-svn\ntestcases.\n\n(Note that this patch might be easier to review using the --word-diff\nand --word-diff-regex=. diff options.)\n\nSuggested-by: Thomas Ferris Nicolaisen <tfnico@gmail.com>\nCc: Eric Wong <normalperson@yhbt.net>\nSigned-off-by: Johan Herland <johan@herland.net>\n---\n Documentation/git-svn.txt                        | 19 +--------\n git-svn.perl                                     | 12 +-----\n t/t9107-git-svn-migrate.sh                       | 54 ++++++++++++------------\n t/t9114-git-svn-dcommit-merge.sh                 |  4 +-\n t/t9116-git-svn-log.sh                           | 46 ++++++++++----------\n t/t9117-git-svn-init-clone.sh                    | 16 +++----\n t/t9118-git-svn-funky-branch-names.sh            | 20 ++++-----\n t/t9120-git-svn-clone-with-percent-escapes.sh    | 14 +++---\n t/t9125-git-svn-multi-glob-branch-names.sh       |  6 +--\n t/t9128-git-svn-cmd-branch.sh                    | 18 ++++----\n t/t9135-git-svn-moved-branch-empty-file.sh       |  2 +-\n t/t9141-git-svn-multiple-branches.sh             | 28 ++++++------\n t/t9145-git-svn-master-branch.sh                 |  2 +-\n t/t9155-git-svn-fetch-deleted-tag.sh             |  4 +-\n t/t9156-git-svn-fetch-deleted-tag-2.sh           |  6 +--\n t/t9161-git-svn-mergeinfo-push.sh                | 22 +++++-----\n t/t9163-git-svn-reset-clears-caches.sh           |  4 +-\n t/t9165-git-svn-fetch-merge-branch-of-branch.sh  |  2 +-\n t/t9166-git-svn-fetch-merge-branch-of-branch2.sh |  2 +-\n t/t9167-git-svn-cmd-branch-subproject.sh         |  2 +-\n 20 files changed, 128 insertions(+), 155 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 59e912e..43da05a 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -86,14 +86,7 @@ COMMANDS\n \t(refs/remotes/$remote/*). Setting a prefix is also useful\n \tif you wish to track multiple projects that share a common\n \trepository.\n-+\n-NOTE: In Git v2.0, the default prefix will CHANGE from \"\" (no prefix)\n-to \"origin/\". This is done to put SVN-tracking refs at\n-\"refs/remotes/origin/*\" instead of \"refs/remotes/*\", and make them\n-more compatible with how Git's own remote-tracking refs are organized\n-(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,\n-by using the --prefix option.\n-\n+\tBy default, the prefix is set to 'origin/'.\n --ignore-paths=<regex>;;\n \tWhen passed to 'init' or 'clone' this regular expression will\n \tbe preserved as a config key.  See 'fetch' for a description\n@@ -987,16 +980,6 @@ without giving any repository layout options.  If the full history with\n branches and tags is required, the options '--trunk' / '--branches' /\n '--tags' must be used.\n \n-When using the options for describing the repository layout (--trunk,\n---tags, --branches, --stdlayout), please also specify the --prefix\n-option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be\n-placed at refs/remotes/origin/* rather than the default refs/remotes/*.\n-The former is more compatible with the layout of Git's \"regular\"\n-remote-tracking refs (refs/remotes/$remote/*), and may potentially\n-prevent similarly named SVN branches and Git remotes from clobbering\n-eachother. In Git v2.0 the default prefix used (i.e. when no --prefix\n-is given) will change from \"\" (no prefix) to \"origin/\".\n-\n When using multiple --branches or --tags, 'git svn' does not automatically\n handle name collisions (for example, if two branches from different paths have\n the same name, or if a branch and a tag have the same name).  In these cases,\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 0443a4f..ad3fe66 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1389,17 +1389,7 @@ sub cmd_multi_init {\n \t\tusage(1);\n \t}\n \n-\tunless (defined $_prefix) {\n-\t\t$_prefix = '';\n-\t\twarn <<EOF\n-WARNING: --prefix is not given, defaulting to empty prefix.\n-         This is probably not what you want! In order to stay compatible\n-         with regular remote-tracking refs, provide a prefix like\n-         --prefix=origin/ (remember the trailing slash), which will cause\n-         the SVN-tracking refs to be placed at refs/remotes/origin/*.\n-NOTE: In Git v2.0, the default prefix will change from empty to 'origin/'.\n-EOF\n-\t}\n+\t$_prefix = 'origin/' unless defined $_prefix;\n \tif (defined $url) {\n \t\t$url = canonicalize_url($url);\n \t\tinit_subdir(@_);\ndiff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh\nindex ee73013..6e69fc4 100755\n--- a/t/t9107-git-svn-migrate.sh\n+++ b/t/t9107-git-svn-migrate.sh\n@@ -45,27 +45,27 @@ test_expect_success 'initialize old-style (v0) git svn layout' '\n test_expect_success 'initialize a multi-repository repo' '\n \tgit svn init \"$svnrepo\" -T trunk -t tags -b branches &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n-\tgrep \"^trunk:refs/remotes/trunk$\" fetch.out &&\n+\tgrep \"^trunk:refs/remotes/origin/trunk$\" fetch.out &&\n \ttest -n \"`git config --get svn-remote.svn.branches \\\n-\t            \"^branches/\\*:refs/remotes/\\*$\"`\" &&\n+\t            \"^branches/\\*:refs/remotes/origin/\\*$\"`\" &&\n \ttest -n \"`git config --get svn-remote.svn.tags \\\n-\t            \"^tags/\\*:refs/remotes/tags/\\*$\"`\" &&\n+\t            \"^tags/\\*:refs/remotes/origin/tags/\\*$\"`\" &&\n \tgit config --unset svn-remote.svn.branches \\\n-\t                        \"^branches/\\*:refs/remotes/\\*$\" &&\n+\t                        \"^branches/\\*:refs/remotes/origin/\\*$\" &&\n \tgit config --unset svn-remote.svn.tags \\\n-\t                        \"^tags/\\*:refs/remotes/tags/\\*$\" &&\n-\tgit config --add svn-remote.svn.fetch \"branches/a:refs/remotes/a\" &&\n-\tgit config --add svn-remote.svn.fetch \"branches/b:refs/remotes/b\" &&\n+\t                        \"^tags/\\*:refs/remotes/origin/tags/\\*$\" &&\n+\tgit config --add svn-remote.svn.fetch \"branches/a:refs/remotes/origin/a\" &&\n+\tgit config --add svn-remote.svn.fetch \"branches/b:refs/remotes/origin/b\" &&\n \tfor i in tags/0.1 tags/0.2 tags/0.3; do\n \t\tgit config --add svn-remote.svn.fetch \\\n-\t\t                 $i:refs/remotes/$i || exit 1; done &&\n+\t\t                 $i:refs/remotes/origin/$i || exit 1; done &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n-\tgrep \"^trunk:refs/remotes/trunk$\" fetch.out &&\n-\tgrep \"^branches/a:refs/remotes/a$\" fetch.out &&\n-\tgrep \"^branches/b:refs/remotes/b$\" fetch.out &&\n-\tgrep \"^tags/0\\.1:refs/remotes/tags/0\\.1$\" fetch.out &&\n-\tgrep \"^tags/0\\.2:refs/remotes/tags/0\\.2$\" fetch.out &&\n-\tgrep \"^tags/0\\.3:refs/remotes/tags/0\\.3$\" fetch.out &&\n+\tgrep \"^trunk:refs/remotes/origin/trunk$\" fetch.out &&\n+\tgrep \"^branches/a:refs/remotes/origin/a$\" fetch.out &&\n+\tgrep \"^branches/b:refs/remotes/origin/b$\" fetch.out &&\n+\tgrep \"^tags/0\\.1:refs/remotes/origin/tags/0\\.1$\" fetch.out &&\n+\tgrep \"^tags/0\\.2:refs/remotes/origin/tags/0\\.2$\" fetch.out &&\n+\tgrep \"^tags/0\\.3:refs/remotes/origin/tags/0\\.3$\" fetch.out &&\n \tgrep \"^:refs/${remotes_git_svn}\" fetch.out\n \t'\n \n@@ -73,14 +73,14 @@ test_expect_success 'initialize a multi-repository repo' '\n test_expect_success 'multi-fetch works on partial urls + paths' \"\n \tgit svn multi-fetch &&\n \tfor i in trunk a b tags/0.1 tags/0.2 tags/0.3; do\n-\t\tgit rev-parse --verify refs/remotes/\\$i^0 >> refs.out || exit 1;\n+\t\tgit rev-parse --verify refs/remotes/origin/\\$i^0 >> refs.out || exit 1;\n \t    done &&\n \ttest -z \\\"\\`sort < refs.out | uniq -d\\`\\\" &&\n \tfor i in trunk a b tags/0.1 tags/0.2 tags/0.3; do\n \t  for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do\n \t\tif test \\$j != \\$i; then continue; fi\n-\t    test -z \\\"\\`git diff refs/remotes/\\$i \\\n-\t                         refs/remotes/\\$j\\`\\\" ||exit 1; done; done\n+\t    test -z \\\"\\`git diff refs/remotes/origin/\\$i \\\n+\t                         refs/remotes/origin/\\$j\\`\\\" ||exit 1; done; done\n \t\"\n \n test_expect_success 'migrate --minimize on old inited layout' '\n@@ -98,27 +98,27 @@ test_expect_success 'migrate --minimize on old inited layout' '\n \tgit svn migrate --minimize &&\n \ttest -z \"`git config -l | grep \"^svn-remote\\.git-svn\\.\"`\" &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n-\tgrep \"^trunk:refs/remotes/trunk$\" fetch.out &&\n-\tgrep \"^branches/a:refs/remotes/a$\" fetch.out &&\n-\tgrep \"^branches/b:refs/remotes/b$\" fetch.out &&\n-\tgrep \"^tags/0\\.1:refs/remotes/tags/0\\.1$\" fetch.out &&\n-\tgrep \"^tags/0\\.2:refs/remotes/tags/0\\.2$\" fetch.out &&\n-\tgrep \"^tags/0\\.3:refs/remotes/tags/0\\.3$\" fetch.out &&\n+\tgrep \"^trunk:refs/remotes/origin/trunk$\" fetch.out &&\n+\tgrep \"^branches/a:refs/remotes/origin/a$\" fetch.out &&\n+\tgrep \"^branches/b:refs/remotes/origin/b$\" fetch.out &&\n+\tgrep \"^tags/0\\.1:refs/remotes/origin/tags/0\\.1$\" fetch.out &&\n+\tgrep \"^tags/0\\.2:refs/remotes/origin/tags/0\\.2$\" fetch.out &&\n+\tgrep \"^tags/0\\.3:refs/remotes/origin/tags/0\\.3$\" fetch.out &&\n \tgrep \"^:refs/${remotes_git_svn}\" fetch.out\n \t'\n \n test_expect_success  \".rev_db auto-converted to .rev_map.UUID\" '\n \tgit svn fetch -i trunk &&\n-\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)\" &&\n-\texpect=\"$(ls \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_map.*)\" &&\n+\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)\" &&\n+\texpect=\"$(ls \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_map.*)\" &&\n \ttest -n \"$expect\" &&\n \trev_db=\"$(echo $expect | sed -e \"s,_map,_db,\")\" &&\n \tconvert_to_rev_db \"$expect\" \"$rev_db\" &&\n \trm -f \"$expect\" &&\n \ttest -f \"$rev_db\" &&\n \tgit svn fetch -i trunk &&\n-\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)\" &&\n-\ttest ! -e \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_db &&\n+\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)\" &&\n+\ttest ! -e \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_db &&\n \ttest -f \"$expect\"\n \t'\n \ndiff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\nindex f524d2f..6f0968a 100755\n--- a/t/t9114-git-svn-dcommit-merge.sh\n+++ b/t/t9114-git-svn-dcommit-merge.sh\n@@ -48,7 +48,7 @@ test_expect_success 'setup svn repository' '\n test_expect_success 'setup git mirror and merge' '\n \tgit svn init \"$svnrepo\" -t tags -T trunk -b branches &&\n \tgit svn fetch &&\n-\tgit checkout -b svn remotes/trunk &&\n+\tgit checkout -b svn remotes/origin/trunk &&\n \tgit checkout -b merge &&\n \techo new file > new_file &&\n \tgit add new_file &&\n@@ -81,7 +81,7 @@ test_debug 'gitk --all & sleep 1'\n \n test_expect_success 'verify post-merge ancestry' \"\n \ttest x\\`git rev-parse --verify refs/heads/svn\\` = \\\n-\t     x\\`git rev-parse --verify refs/remotes/trunk \\` &&\n+\t     x\\`git rev-parse --verify refs/remotes/origin/trunk \\` &&\n \ttest x\\`git rev-parse --verify refs/heads/svn^2\\` = \\\n \t     x\\`git rev-parse --verify refs/heads/merge\\` &&\n \tgit cat-file commit refs/heads/svn^ | grep '^friend$'\ndiff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh\nindex cf4c052..45773ee 100755\n--- a/t/t9116-git-svn-log.sh\n+++ b/t/t9116-git-svn-log.sh\n@@ -20,20 +20,20 @@ test_expect_success 'setup repository and import' '\n \t) &&\n \tgit svn init \"$svnrepo\" -T trunk -b branches -t tags &&\n \tgit svn fetch &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \techo bye >> README &&\n \tgit commit -a -m bye &&\n \tgit svn dcommit &&\n-\tgit reset --hard a &&\n+\tgit reset --hard origin/a &&\n \techo why >> FEEDME &&\n \tgit update-index --add FEEDME &&\n \tgit commit -m feedme &&\n \tgit svn dcommit &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \techo aye >> README &&\n \tgit commit -a -m aye &&\n \tgit svn dcommit &&\n-\tgit reset --hard b &&\n+\tgit reset --hard origin/b &&\n \techo spy >> README &&\n \tgit commit -a -m spy &&\n \techo try >> README &&\n@@ -42,26 +42,26 @@ test_expect_success 'setup repository and import' '\n \t'\n \n test_expect_success 'run log' \"\n-\tgit reset --hard a &&\n-\tgit svn log -r2 trunk | grep ^r2 &&\n-\tgit svn log -r4 trunk | grep ^r4 &&\n+\tgit reset --hard origin/a &&\n+\tgit svn log -r2 origin/trunk | grep ^r2 &&\n+\tgit svn log -r4 origin/trunk | grep ^r4 &&\n \tgit svn log -r3 | grep ^r3\n \t\"\n \n test_expect_success 'run log against a from trunk' \"\n-\tgit reset --hard trunk &&\n-\tgit svn log -r3 a | grep ^r3\n+\tgit reset --hard origin/trunk &&\n+\tgit svn log -r3 origin/a | grep ^r3\n \t\"\n \n printf 'r1 \\nr2 \\nr4 \\n' > expected-range-r1-r2-r4\n \n test_expect_success 'test ascending revision range' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -\n \t\"\n \n test_expect_success 'test ascending revision range with --show-commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -\n \t\"\n \n@@ -69,7 +69,7 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' \"\n \tgit svn find-rev r1 >expected-range-r1-r2-r4-sha1 &&\n \tgit svn find-rev r2 >>expected-range-r1-r2-r4-sha1 &&\n \tgit svn find-rev r4 >>expected-range-r1-r2-r4-sha1 &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f2 >out &&\n \tgit rev-parse \\$(cat out) >actual &&\n \ttest_cmp expected-range-r1-r2-r4-sha1 actual\n@@ -78,67 +78,67 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' \"\n printf 'r4 \\nr2 \\nr1 \\n' > expected-range-r4-r2-r1\n \n test_expect_success 'test descending revision range' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 4:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4-r2-r1 -\n \t\"\n \n printf 'r1 \\nr2 \\n' > expected-range-r1-r2\n \n test_expect_success 'test ascending revision range with unreachable revision' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 1:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2 -\n \t\"\n \n printf 'r2 \\nr1 \\n' > expected-range-r2-r1\n \n test_expect_success 'test descending revision range with unreachable revision' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2-r1 -\n \t\"\n \n printf 'r2 \\n' > expected-range-r2\n \n test_expect_success 'test ascending revision range with unreachable upper boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 2:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable upper boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:2 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -\n \t\"\n \n printf 'r4 \\n' > expected-range-r4\n \n test_expect_success 'test ascending revision range with unreachable lower boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable lower boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 4:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \n printf -- '------------------------------------------------------------------------\\n' > expected-separator\n \n test_expect_success 'test ascending revision range with unreachable boundary revisions and no commits' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 5:6 | test_cmp expected-separator -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable boundary revisions and no commits' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 6:5 | test_cmp expected-separator -\n \t\"\n \n test_expect_success 'test ascending revision range with unreachable boundary revisions and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:5 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable boundary revisions and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 5:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \ndiff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh\nindex 1c8d049..bea6145 100755\n--- a/t/t9117-git-svn-init-clone.sh\n+++ b/t/t9117-git-svn-init-clone.sh\n@@ -83,25 +83,25 @@ EOF\n \trm -f expect actual\n }\n \n-test_expect_success 'init with -s/-T/-b/-t without --prefix warns' '\n+test_expect_success 'init with -s/-T/-b/-t assumes --prefix=origin/' '\n \ttest ! -d project &&\n \tgit svn init -s \"$svnrepo\"/project project 2>warning &&\n-\tgrep -q prefix warning &&\n-\ttest_svn_configured_prefix \"\" &&\n+\ttest_must_fail grep -q prefix warning &&\n+\ttest_svn_configured_prefix \"origin/\" &&\n \trm -rf project &&\n \trm -f warning\n \t'\n \n-test_expect_success 'clone with -s/-T/-b/-t without --prefix warns' '\n+test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' '\n \ttest ! -d project &&\n \tgit svn clone -s \"$svnrepo\"/project 2>warning &&\n-\tgrep -q prefix warning &&\n-\ttest_svn_configured_prefix \"\" &&\n+\ttest_must_fail grep -q prefix warning &&\n+\ttest_svn_configured_prefix \"origin/\" &&\n \trm -rf project &&\n \trm -f warning\n \t'\n \n-test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '\n+test_expect_success 'init with -s/-T/-b/-t and --prefix=\"\" still works' '\n \ttest ! -d project &&\n \tgit svn init -s \"$svnrepo\"/project project --prefix=\"\" 2>warning &&\n \ttest_must_fail grep -q prefix warning &&\n@@ -110,7 +110,7 @@ test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '\n \trm -f warning\n \t'\n \n-test_expect_success 'clone with -s/-T/-b/-t and --prefix does not warn' '\n+test_expect_success 'clone with -s/-T/-b/-t and --prefix=\"\" still works' '\n \ttest ! -d project &&\n \tgit svn clone -s \"$svnrepo\"/project --prefix=\"\" 2>warning &&\n \ttest_must_fail grep -q prefix warning &&\ndiff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh\nindex 15f93b4..ed4d136 100755\n--- a/t/t9118-git-svn-funky-branch-names.sh\n+++ b/t/t9118-git-svn-funky-branch-names.sh\n@@ -41,20 +41,20 @@ test_expect_success 'test clone with funky branch names' '\n \tgit svn clone -s \"$svnrepo/pr ject\" project &&\n \t(\n \t\tcd project &&\n-\t\tgit rev-parse \"refs/remotes/fun%20plugin\" &&\n-\t\tgit rev-parse \"refs/remotes/more%20fun%20plugin!\" &&\n-\t\tgit rev-parse \"refs/remotes/$scary_ref\" &&\n-\t\tgit rev-parse \"refs/remotes/%2Eleading_dot\" &&\n-\t\tgit rev-parse \"refs/remotes/trailing_dot%2E\" &&\n-\t\tgit rev-parse \"refs/remotes/trailing_dotlock%2Elock\" &&\n-\t\tgit rev-parse \"refs/remotes/$non_reflog\"\n+\t\tgit rev-parse \"refs/remotes/origin/fun%20plugin\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/more%20fun%20plugin!\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/$scary_ref\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/%2Eleading_dot\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/trailing_dot%2E\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/trailing_dotlock%2Elock\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/$non_reflog\"\n \t)\n \t'\n \n test_expect_success 'test dcommit to funky branch' \"\n \t(\n \t\tcd project &&\n-\t\tgit reset --hard 'refs/remotes/more%20fun%20plugin!' &&\n+\t\tgit reset --hard 'refs/remotes/origin/more%20fun%20plugin!' &&\n \t\techo hello >> foo &&\n \t\tgit commit -m 'hello' -- foo &&\n \t\tgit svn dcommit\n@@ -64,7 +64,7 @@ test_expect_success 'test dcommit to funky branch' \"\n test_expect_success 'test dcommit to scary branch' '\n \t(\n \t\tcd project &&\n-\t\tgit reset --hard \"refs/remotes/$scary_ref\" &&\n+\t\tgit reset --hard \"refs/remotes/origin/$scary_ref\" &&\n \t\techo urls are scary >> foo &&\n \t\tgit commit -m \"eep\" -- foo &&\n \t\tgit svn dcommit\n@@ -74,7 +74,7 @@ test_expect_success 'test dcommit to scary branch' '\n test_expect_success 'test dcommit to trailing_dotlock branch' '\n \t(\n \t\tcd project &&\n-\t\tgit reset --hard \"refs/remotes/trailing_dotlock%2Elock\" &&\n+\t\tgit reset --hard \"refs/remotes/origin/trailing_dotlock%2Elock\" &&\n \t\techo who names branches like this anyway? >> foo &&\n \t\tgit commit -m \"bar\" -- foo &&\n \t\tgit svn dcommit\ndiff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh\nindex 1d92c05..1c84ce1 100755\n--- a/t/t9120-git-svn-clone-with-percent-escapes.sh\n+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh\n@@ -58,19 +58,19 @@ test_expect_success 'test clone --stdlayout with percent escapes' '\n \tgit svn clone --stdlayout \"$svnrepo/pr%20ject\" percent &&\n \t(\n \t\tcd percent &&\n-\t\tgit rev-parse refs/remotes/trunk^0 &&\n-\t\tgit rev-parse refs/remotes/b^0 &&\n-\t\tgit rev-parse refs/remotes/tags/v1^0\n+\t\tgit rev-parse refs/remotes/origin/trunk^0 &&\n+\t\tgit rev-parse refs/remotes/origin/b^0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v1^0\n \t)\n '\n \n test_expect_success 'test clone -s with unescaped space' '\n-\tgit svn clone -s \"$svnrepo/pr ject\" space &&\n+\tgit svn clone -s \"$svnrepo/pr ject\" --prefix origin/ space &&\n \t(\n \t\tcd space &&\n-\t\tgit rev-parse refs/remotes/trunk^0 &&\n-\t\tgit rev-parse refs/remotes/b^0 &&\n-\t\tgit rev-parse refs/remotes/tags/v1^0\n+\t\tgit rev-parse refs/remotes/origin/trunk^0 &&\n+\t\tgit rev-parse refs/remotes/origin/b^0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v1^0\n \t)\n '\n \ndiff --git a/t/t9125-git-svn-multi-glob-branch-names.sh b/t/t9125-git-svn-multi-glob-branch-names.sh\nindex 096abd1..0d53fc9 100755\n--- a/t/t9125-git-svn-multi-glob-branch-names.sh\n+++ b/t/t9125-git-svn-multi-glob-branch-names.sh\n@@ -20,14 +20,14 @@ test_expect_success 'test clone with multi-glob in branch names' '\n \tgit svn clone -T trunk -b branches/*/* -t tags \\\n \t              \"$svnrepo/project\" project &&\n \t(cd project &&\n-\t\tgit rev-parse \"refs/remotes/v14.1/beta\" &&\n-\t\tgit rev-parse \"refs/remotes/v14.1/gold\"\n+\t\tgit rev-parse \"refs/remotes/origin/v14.1/beta\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/v14.1/gold\"\n \t)\n \t'\n \n test_expect_success 'test dcommit to multi-globbed branch' \"\n \t(cd project &&\n-\tgit reset --hard 'refs/remotes/v14.1/gold' &&\n+\tgit reset --hard 'refs/remotes/origin/v14.1/gold' &&\n \techo hello >> foo &&\n \tgit commit -m 'hello' -- foo &&\n \tgit svn dcommit\ndiff --git a/t/t9128-git-svn-cmd-branch.sh b/t/t9128-git-svn-cmd-branch.sh\nindex 4b034a6..4e95f79 100755\n--- a/t/t9128-git-svn-cmd-branch.sh\n+++ b/t/t9128-git-svn-cmd-branch.sh\n@@ -29,30 +29,30 @@ test_expect_success 'initialize svnrepo' '\n test_expect_success 'import into git' '\n \tgit svn init --stdlayout \"$svnrepo\" &&\n \tgit svn fetch &&\n-\tgit checkout remotes/trunk\n+\tgit checkout remotes/origin/trunk\n '\n \n test_expect_success 'git svn branch tests' '\n \tgit svn branch a &&\n \tbase=$(git rev-parse HEAD:) &&\n-\ttest $base = $(git rev-parse remotes/a:) &&\n+\ttest $base = $(git rev-parse remotes/origin/a:) &&\n \tgit svn branch -m \"created branch b blah\" b &&\n-\ttest $base = $(git rev-parse remotes/b:) &&\n+\ttest $base = $(git rev-parse remotes/origin/b:) &&\n \ttest_must_fail git branch -m \"no branchname\" &&\n \tgit svn branch -n c &&\n-\ttest_must_fail git rev-parse remotes/c &&\n+\ttest_must_fail git rev-parse remotes/origin/c &&\n \ttest_must_fail git svn branch a &&\n \tgit svn branch -t tag1 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag1:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag1:) &&\n \tgit svn branch --tag tag2 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag2:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag2:) &&\n \tgit svn tag tag3 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag3:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag3:) &&\n \tgit svn tag -m \"created tag4 foo\" tag4 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag4:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag4:) &&\n \ttest_must_fail git svn tag -m \"no tagname\" &&\n \tgit svn tag -n tag5 &&\n-\ttest_must_fail git rev-parse remotes/tags/tag5 &&\n+\ttest_must_fail git rev-parse remotes/origin/tags/tag5 &&\n \ttest_must_fail git svn tag tag1\n '\n \ndiff --git a/t/t9135-git-svn-moved-branch-empty-file.sh b/t/t9135-git-svn-moved-branch-empty-file.sh\nindex 5280e5f..93db45d 100755\n--- a/t/t9135-git-svn-moved-branch-empty-file.sh\n+++ b/t/t9135-git-svn-moved-branch-empty-file.sh\n@@ -12,7 +12,7 @@ test_expect_success 'clone using git svn' 'git svn clone -s \"$svnrepo\" x'\n test_expect_success 'test that b1 exists and is empty' '\n \t(\n \t\tcd x &&\n-\t\tgit reset --hard branch-c &&\n+\t\tgit reset --hard origin/branch-c &&\n \t\ttest -f b1 &&\n \t\t! test -s b1\n \t)\ndiff --git a/t/t9141-git-svn-multiple-branches.sh b/t/t9141-git-svn-multiple-branches.sh\nindex 3cd0671..8e7f7d6 100755\n--- a/t/t9141-git-svn-multiple-branches.sh\n+++ b/t/t9141-git-svn-multiple-branches.sh\n@@ -66,18 +66,18 @@ test_expect_success 'clone multiple branch and tag paths' '\n \t\t      -t tags_A/* --tags tags_B \\\n \t\t      \"$svnrepo/project\" git_project &&\n \t( cd git_project &&\n-\t\tgit rev-parse refs/remotes/first &&\n-\t\tgit rev-parse refs/remotes/second &&\n-\t\tgit rev-parse refs/remotes/1 &&\n-\t\tgit rev-parse refs/remotes/2 &&\n-\t\tgit rev-parse refs/remotes/tags/1.0 &&\n-\t\tgit rev-parse refs/remotes/tags/2.0 &&\n-\t\tgit rev-parse refs/remotes/tags/3.0 &&\n-\t\tgit rev-parse refs/remotes/tags/4.0 &&\n-\t\tgit rev-parse refs/remotes/tags/v5 &&\n-\t\tgit rev-parse refs/remotes/tags/v6 &&\n-\t\tgit rev-parse refs/remotes/tags/v7 &&\n-\t\tgit rev-parse refs/remotes/tags/v8\n+\t\tgit rev-parse refs/remotes/origin/first &&\n+\t\tgit rev-parse refs/remotes/origin/second &&\n+\t\tgit rev-parse refs/remotes/origin/1 &&\n+\t\tgit rev-parse refs/remotes/origin/2 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/1.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/2.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/3.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/4.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v5 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v6 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v7 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v8\n \t)\n '\n \n@@ -85,8 +85,8 @@ test_expect_success 'Multiple branch or tag paths require -d' '\n \t( cd git_project &&\n \t\ttest_must_fail git svn branch -m \"No new branch\" Nope &&\n \t\ttest_must_fail git svn tag -m \"No new tag\" Tagless &&\n-\t\ttest_must_fail git rev-parse refs/remotes/Nope &&\n-\t\ttest_must_fail git rev-parse refs/remotes/tags/Tagless\n+\t\ttest_must_fail git rev-parse refs/remotes/origin/Nope &&\n+\t\ttest_must_fail git rev-parse refs/remotes/origin/tags/Tagless\n \t) &&\n \t( cd svn_project &&\n \t\tsvn_cmd up &&\ndiff --git a/t/t9145-git-svn-master-branch.sh b/t/t9145-git-svn-master-branch.sh\nindex 16852d2..6559137 100755\n--- a/t/t9145-git-svn-master-branch.sh\n+++ b/t/t9145-git-svn-master-branch.sh\n@@ -17,7 +17,7 @@ test_expect_success 'git svn clone --stdlayout sets up trunk as master' '\n \tgit svn clone -s \"$svnrepo\" g &&\n \t(\n \t\tcd g &&\n-\t\ttest x`git rev-parse --verify refs/remotes/trunk^0` = \\\n+\t\ttest x`git rev-parse --verify refs/remotes/origin/trunk^0` = \\\n \t\t     x`git rev-parse --verify refs/heads/master^0`\n \t)\n '\ndiff --git a/t/t9155-git-svn-fetch-deleted-tag.sh b/t/t9155-git-svn-fetch-deleted-tag.sh\nindex a486a98..184336f 100755\n--- a/t/t9155-git-svn-fetch-deleted-tag.sh\n+++ b/t/t9155-git-svn-fetch-deleted-tag.sh\n@@ -35,8 +35,8 @@ test_expect_success 'fetch deleted tags from same revision with checksum error'\n \tcd git_project &&\n \tgit svn fetch &&\n \n-\tgit diff --exit-code mybranch:trunk/subdir/file tags/mytag:file &&\n-\tgit diff --exit-code master:subdir/file tags/mytag^:file\n+\tgit diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&\n+\tgit diff --exit-code master:subdir/file origin/tags/mytag^:file\n '\n \n test_done\ndiff --git a/t/t9156-git-svn-fetch-deleted-tag-2.sh b/t/t9156-git-svn-fetch-deleted-tag-2.sh\nindex 5ce7e2f..7a6e33b 100755\n--- a/t/t9156-git-svn-fetch-deleted-tag-2.sh\n+++ b/t/t9156-git-svn-fetch-deleted-tag-2.sh\n@@ -36,9 +36,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro\n \tcd git_project &&\n \tgit svn fetch &&\n \n-\tgit diff --exit-code master:subdir3/file tags/mytag:file &&\n-\tgit diff --exit-code master:subdir2/file tags/mytag^:file &&\n-\tgit diff --exit-code master:subdir1/file tags/mytag^^:file\n+\tgit diff --exit-code master:subdir3/file origin/tags/mytag:file &&\n+\tgit diff --exit-code master:subdir2/file origin/tags/mytag^:file &&\n+\tgit diff --exit-code master:subdir1/file origin/tags/mytag^^:file\n '\n \n test_done\ndiff --git a/t/t9161-git-svn-mergeinfo-push.sh b/t/t9161-git-svn-mergeinfo-push.sh\nindex 1eab701..6cb0909 100755\n--- a/t/t9161-git-svn-mergeinfo-push.sh\n+++ b/t/t9161-git-svn-mergeinfo-push.sh\n@@ -18,8 +18,8 @@ test_expect_success 'load svn dump' \"\n \n test_expect_success 'propagate merge information' '\n \tgit config svn.pushmergeinfo yes &&\n-\tgit checkout svnb1 &&\n-\tgit merge --no-ff svnb2 &&\n+\tgit checkout origin/svnb1 &&\n+\tgit merge --no-ff origin/svnb2 &&\n \tgit svn dcommit\n \t'\n \n@@ -29,7 +29,7 @@ test_expect_success 'check svn:mergeinfo' '\n \t'\n \n test_expect_success 'merge another branch' '\n-\tgit merge --no-ff svnb3 &&\n+\tgit merge --no-ff origin/svnb3 &&\n \tgit svn dcommit\n \t'\n \n@@ -40,7 +40,7 @@ test_expect_success 'check primary parent mergeinfo respected' '\n \t'\n \n test_expect_success 'merge existing merge' '\n-\tgit merge --no-ff svnb4 &&\n+\tgit merge --no-ff origin/svnb4 &&\n \tgit svn dcommit\n \t'\n \n@@ -53,7 +53,7 @@ test_expect_success \"check both parents' mergeinfo respected\" '\n \t'\n \n test_expect_success 'make further commits to branch' '\n-\tgit checkout svnb2 &&\n+\tgit checkout origin/svnb2 &&\n \ttouch newb2file &&\n \tgit add newb2file &&\n \tgit commit -m \"later b2 commit\" &&\n@@ -64,8 +64,8 @@ test_expect_success 'make further commits to branch' '\n \t'\n \n test_expect_success 'second forward merge' '\n-\tgit checkout svnb1 &&\n-\tgit merge --no-ff svnb2 &&\n+\tgit checkout origin/svnb1 &&\n+\tgit merge --no-ff origin/svnb2 &&\n \tgit svn dcommit\n \t'\n \n@@ -78,8 +78,8 @@ test_expect_success 'check new mergeinfo added' '\n \t'\n \n test_expect_success 'reintegration merge' '\n-\tgit checkout svnb4 &&\n-\tgit merge --no-ff svnb1 &&\n+\tgit checkout origin/svnb4 &&\n+\tgit merge --no-ff origin/svnb1 &&\n \tgit svn dcommit\n \t'\n \n@@ -92,11 +92,11 @@ test_expect_success 'check reintegration mergeinfo' '\n \t'\n \n test_expect_success 'dcommit a merge at the top of a stack' '\n-\tgit checkout svnb1 &&\n+\tgit checkout origin/svnb1 &&\n \ttouch anotherfile &&\n \tgit add anotherfile &&\n \tgit commit -m \"a commit\" &&\n-\tgit merge svnb4 &&\n+\tgit merge origin/svnb4 &&\n \tgit svn dcommit\n \t'\n \ndiff --git a/t/t9163-git-svn-reset-clears-caches.sh b/t/t9163-git-svn-reset-clears-caches.sh\nindex cd4c662..d6245ce 100755\n--- a/t/t9163-git-svn-reset-clears-caches.sh\n+++ b/t/t9163-git-svn-reset-clears-caches.sh\n@@ -70,9 +70,9 @@ test_expect_success 'rebase looses SVN merge (m)' '\n #\n test_expect_success 'reset and fetch gets the SVN merge (m) correctly' '\n \tgit svn reset -r 3 &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn fetch &&\n-\ttest 2 = $(git cat-file -p trunk|grep parent|wc -l)\n+\ttest 2 = $(git cat-file -p origin/trunk|grep parent|wc -l)\n '\n \n test_done\ndiff --git a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh\nindex 13ae7e3..fa3ef3b 100755\n--- a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh\n+++ b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh\n@@ -53,7 +53,7 @@ test_expect_success 'clone svn repo' '\n '\n \n test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&\n-\ty=$(git rev-parse branch2) &&\n+\ty=$(git rev-parse origin/branch2) &&\n \ttest \"x$x\" = \"x$y\"\n '\n \ndiff --git a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh\nindex af0ec0e..52f2e46 100755\n--- a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh\n+++ b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh\n@@ -46,7 +46,7 @@ test_expect_success 'clone svn repo' '\n '\n \n test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&\n-\ty=$(git rev-parse branch2) &&\n+\ty=$(git rev-parse origin/branch2) &&\n \ttest \"x$x\" = \"x$y\"\n '\n \ndiff --git a/t/t9167-git-svn-cmd-branch-subproject.sh b/t/t9167-git-svn-cmd-branch-subproject.sh\nindex 53def87..ba35fc0 100755\n--- a/t/t9167-git-svn-cmd-branch-subproject.sh\n+++ b/t/t9167-git-svn-cmd-branch-subproject.sh\n@@ -31,7 +31,7 @@ test_expect_success 'import into git' '\n \tgit svn init --trunk=trunk/project --branches=branches/*/project \\\n \t\t--tags=tags/*/project \"$svnrepo\" &&\n \tgit svn fetch &&\n-\tgit checkout remotes/trunk\n+\tgit checkout remotes/origin/trunk\n '\n \n test_expect_success 'git svn branch tests' '\n-- \n1.8.4.653.g2df02b3\n"},{"id":"228578","messageId":"1B588C9FE7614A6080C98FD340530DA5@PhilipOakley","threadId":"34745","inReplyTo":"1381015833-696-1-git-send-email-johan@herland.net","subject":"Re: [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2013-10-06T09:51:03Z","receivedAt":"2013-10-06T09:51:03Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Johan Herland\" <johan@herland.net>\n> Currently, the git-svn defaults to using an empty prefix, which ends\n> up placing the SVN-tracking refs directly in refs/remotes/*. This\n> placement runs counter to Git's convention of placing remote-tracking\n> branches in refs/remotes/$remote/*.\n<snip>\n>\n> This is also in preparation for changing the default value of --prefix\n> at some point in the future.\n>\n> Cc: Eric Wong <normalperson@yhbt.net>\n\nExcuse my ignorance, but what is the \"Carbon copy:\" line meant to \nsignify?\nShould it be a double \"Signed-of-by:\" or one of the other \"-by:\" lines?\n\n> Signed-off-by: Johan Herland <johan@herland.net>\n> ---\n> Documentation/git-svn.txt | 35 +++++++++++++++++++++++++----------\n> 1 file changed, 25 insertions(+), 10 deletions(-)\n<snip>\n\nPhilip Oakley \n"},{"id":"228580","messageId":"CALKQrgdruayiosT1nQSXGn44T4dGbjNYquuq5tZjyiNSQNd6rw@mail.gmail.com","threadId":"34745","inReplyTo":"1B588C9FE7614A6080C98FD340530DA5@PhilipOakley","subject":"Re: [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-10-06T13:46:57Z","receivedAt":"2013-10-06T13:46:57Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Sun, Oct 6, 2013 at 11:51 AM, Philip Oakley <philipoakley@iee.org> wrote:\n> From: \"Johan Herland\" <johan@herland.net>\n>> Cc: Eric Wong <normalperson@yhbt.net>\n>\n> Excuse my ignorance, but what is the \"Carbon copy:\" line meant to signify?\n> Should it be a double \"Signed-of-by:\" or one of the other \"-by:\" lines?\n\nNo, it's not a Signed-off-by, it's merely a hint to someone that they\nmight want to take a closer look at this patch.\n\nIn this case, I'm Cc-ing Eric Wong, as he is the main git-svn author,\nand I consider his feedback on these patches very valuable. When I add\na Cc: to the commit message, git send-email picks it up, and adds him\nto the Cc-list of the resulting email. I could have achieved the same\nby passing --cc \"Eric ...\" directly to git-send-email, but sometimes\nthere might be quite a while between preparing the commit and running\ngit send-email, and in those cases adding the Cc to the commit message\nsaves me from forgetting to Cc him when I some time later get around\nto running git send-email.\n\nThat said, my hope is obviously that Eric will have the\ntime/energy/motivation to review these patches, so that I (or someone\nelse) can later replace the \"Cc:\" line with a corresponding\n\"Reviewed-by:\" or \"Acked-by:\". Even if that does not happen, and the\n\"Cc:\" line ends up in the recorded history of Git, I don't consider\nthat a big problem either; a 'git log origin/master | grep \"^\\s*Cc: \"\n| wc -l' yields 148 existing cases...\n\nHope that helps,\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"228633","messageId":"CAPig+cQfWSY=NdynKOcrVrjoncjz_sNsJ40EpTMmp4FbyLZKmg@mail.gmail.com","threadId":"34745","inReplyTo":"1381015833-696-1-git-send-email-johan@herland.net","subject":"Re: [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-10-09T01:33:02Z","receivedAt":"2013-10-09T01:33:02Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Oct 5, 2013 at 7:30 PM, Johan Herland <johan@herland.net> wrote:\n> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\n> index 4dd3bcb..da00671 100644\n> --- a/Documentation/git-svn.txt\n> +++ b/Documentation/git-svn.txt\n> @@ -973,6 +979,15 @@ without giving any repository layout options.  If the full history with\n>  branches and tags is required, the options '--trunk' / '--branches' /\n>  '--tags' must be used.\n>\n> +When using the options for describing the repository layout (--trunk,\n> +--tags, --branches, --stdlayout), please also specify the --prefix\n> +option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be\n> +placed at refs/remotes/origin/* rather than the default refs/remotes/*.\n> +The former is more compatible with the layout of Git's \"regular\"\n> +remote-tracking refs (refs/remotes/$remote/*), and may potentially\n> +prevent similarly named SVN branches and Git remotes from clobbering\n> +eachother.\n\ns/eachother/each other/\n\n>  When using multiple --branches or --tags, 'git svn' does not automatically\n>  handle name collisions (for example, if two branches from different paths have\n>  the same name, or if a branch and a tag have the same name).  In these cases,\n> @@ -1035,8 +1050,8 @@ comma-separated list of names within braces. For example:\n>  [svn-remote \"huge-project\"]\n>         url = http://server.org/svn\n>         fetch = trunk/src:refs/remotes/trunk\n> -       branches = branches/{red,green}/src:refs/remotes/branches/*\n> -       tags = tags/{1.0,2.0}/src:refs/remotes/tags/*\n> +       branches = branches/{red,green}/src:refs/remotes/project-a/branches/*\n> +       tags = tags/{1.0,2.0}/src:refs/remotes/project-a/tags/*\n>  ------------------------------------------------------------------------\n>\n>  Multiple fetch, branches, and tags keys are supported:\n> --\n"},{"id":"228634","messageId":"CAPig+cRAg4NpAsUWGQPsLcaFmDn61POv1pdHKCrSyQbM0KgM4A@mail.gmail.com","threadId":"34745","inReplyTo":"1381015833-696-2-git-send-email-johan@herland.net","subject":"Re: [RFC/PATCHv2 2/3] git-svn: Warn about changing default for --prefix in Git v2.0","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-10-09T01:34:45Z","receivedAt":"2013-10-09T01:34:45Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Oct 5, 2013 at 7:30 PM, Johan Herland <johan@herland.net> wrote:\n> diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh\n> index b7ef9e2..1c8d049 100755\n> --- a/t/t9117-git-svn-init-clone.sh\n> +++ b/t/t9117-git-svn-init-clone.sh\n> @@ -52,4 +52,71 @@ test_expect_success 'clone to target directory with --stdlayout' '\n>         rm -rf target\n>         '\n>\n> +test_expect_success 'clone without -s/-T/-b/-t does not warn' '\n> +       test ! -d trunk &&\n> +       git svn clone \"$svnrepo\"/project/trunk 2>warning &&\n> +       test_must_fail grep -q prefix warning &&\n> +       rm -rf trunk &&\n> +       rm -f warning\n> +       '\n> +\n> +test_svn_configured_prefix () {\n> +       prefix=$1\n\nDid you want to maintain the &&-chain here?\n\n> +       cat >expect <<EOF\n\nAnd here?\n\n> +project/trunk:refs/remotes/${prefix}trunk\n> +project/branches/*:refs/remotes/${prefix}*\n> +project/tags/*:refs/remotes/${prefix}tags/*\n> +EOF\n> +       test ! -f actual &&\n> +       git --git-dir=project/.git config svn-remote.svn.fetch >>actual &&\n> +       git --git-dir=project/.git config svn-remote.svn.branches >>actual &&\n> +       git --git-dir=project/.git config svn-remote.svn.tags >>actual &&\n> +       test_cmp expect actual &&\n> +       rm -f expect actual\n> +}\n"},{"id":"228643","messageId":"CALKQrgf1CHm7Wnxh6iyF4yieSCcKa8_mfUPxw+mY1OTDja7ing@mail.gmail.com","threadId":"34745","inReplyTo":"CAPig+cQfWSY=NdynKOcrVrjoncjz_sNsJ40EpTMmp4FbyLZKmg@mail.gmail.com","subject":"Re: [RFC/PATCHv2 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-10-09T12:06:51Z","receivedAt":"2013-10-09T12:06:51Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Wed, Oct 9, 2013 at 3:33 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n> On Sat, Oct 5, 2013 at 7:30 PM, Johan Herland <johan@herland.net> wrote:\n>> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\n>> index 4dd3bcb..da00671 100644\n>> --- a/Documentation/git-svn.txt\n>> +++ b/Documentation/git-svn.txt\n>> @@ -973,6 +979,15 @@ without giving any repository layout options.  If the full history with\n>>  branches and tags is required, the options '--trunk' / '--branches' /\n>>  '--tags' must be used.\n>>\n>> +When using the options for describing the repository layout (--trunk,\n>> +--tags, --branches, --stdlayout), please also specify the --prefix\n>> +option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be\n>> +placed at refs/remotes/origin/* rather than the default refs/remotes/*.\n>> +The former is more compatible with the layout of Git's \"regular\"\n>> +remote-tracking refs (refs/remotes/$remote/*), and may potentially\n>> +prevent similarly named SVN branches and Git remotes from clobbering\n>> +eachother.\n>\n> s/eachother/each other/\n\nThanks, will fix.\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"228644","messageId":"CALKQrgd3wPEwK2vHkFPgt2hXASwB0ypAjzvnR8fV-WAgjggdqg@mail.gmail.com","threadId":"34745","inReplyTo":"CAPig+cRAg4NpAsUWGQPsLcaFmDn61POv1pdHKCrSyQbM0KgM4A@mail.gmail.com","subject":"Re: [RFC/PATCHv2 2/3] git-svn: Warn about changing default for --prefix in Git v2.0","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-10-09T12:18:11Z","receivedAt":"2013-10-09T12:18:11Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Wed, Oct 9, 2013 at 3:34 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n> On Sat, Oct 5, 2013 at 7:30 PM, Johan Herland <johan@herland.net> wrote:\n>> diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh\n>> index b7ef9e2..1c8d049 100755\n>> --- a/t/t9117-git-svn-init-clone.sh\n>> +++ b/t/t9117-git-svn-init-clone.sh\n>> @@ -52,4 +52,71 @@ test_expect_success 'clone to target directory with --stdlayout' '\n>>         rm -rf target\n>>         '\n>>\n>> +test_expect_success 'clone without -s/-T/-b/-t does not warn' '\n>> +       test ! -d trunk &&\n>> +       git svn clone \"$svnrepo\"/project/trunk 2>warning &&\n>> +       test_must_fail grep -q prefix warning &&\n>> +       rm -rf trunk &&\n>> +       rm -f warning\n>> +       '\n>> +\n>> +test_svn_configured_prefix () {\n>> +       prefix=$1\n>\n> Did you want to maintain the &&-chain here?\n>\n>> +       cat >expect <<EOF\n>\n> And here?\n\nYes, will add && in both places. Thanks.\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"228731","messageId":"1381496227-28700-1-git-send-email-johan@herland.net","threadId":"34745","inReplyTo":"1381015833-696-1-git-send-email-johan@herland.net","subject":"[RFC/PATCHv3 0/3] Change git-svn's default --prefix in Git v2.0","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-10-11T12:57:04Z","receivedAt":"2013-10-11T12:57:04Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"Hi,\n\nAnother iteration, identical to v2, except for the fixes suggested by\nEric Sunshine.\n\n...Johan\n\n\nJohan Herland (3):\n  Documentation/git-svn: Promote the use of --prefix in docs + examples\n  git-svn: Warn about changing default for --prefix in Git v2.0\n  Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given\n\n Documentation/git-svn.txt                        | 27 ++++++----\n git-svn.perl                                     |  2 +-\n t/t9107-git-svn-migrate.sh                       | 54 +++++++++----------\n t/t9114-git-svn-dcommit-merge.sh                 |  4 +-\n t/t9116-git-svn-log.sh                           | 46 ++++++++--------\n t/t9117-git-svn-init-clone.sh                    | 67 ++++++++++++++++++++++++\n t/t9118-git-svn-funky-branch-names.sh            | 20 +++----\n t/t9120-git-svn-clone-with-percent-escapes.sh    | 14 ++---\n t/t9125-git-svn-multi-glob-branch-names.sh       |  6 +--\n t/t9128-git-svn-cmd-branch.sh                    | 18 +++----\n t/t9135-git-svn-moved-branch-empty-file.sh       |  2 +-\n t/t9141-git-svn-multiple-branches.sh             | 28 +++++-----\n t/t9145-git-svn-master-branch.sh                 |  2 +-\n t/t9155-git-svn-fetch-deleted-tag.sh             |  4 +-\n t/t9156-git-svn-fetch-deleted-tag-2.sh           |  6 +--\n t/t9161-git-svn-mergeinfo-push.sh                | 22 ++++----\n t/t9163-git-svn-reset-clears-caches.sh           |  4 +-\n t/t9165-git-svn-fetch-merge-branch-of-branch.sh  |  2 +-\n t/t9166-git-svn-fetch-merge-branch-of-branch2.sh |  2 +-\n t/t9167-git-svn-cmd-branch-subproject.sh         |  2 +-\n 20 files changed, 203 insertions(+), 129 deletions(-)\n\n-- \n1.8.4.653.g2df02b3\n"},{"id":"228733","messageId":"1381496227-28700-2-git-send-email-johan@herland.net","threadId":"34745","inReplyTo":"1381496227-28700-1-git-send-email-johan@herland.net","subject":"[RFC/PATCHv3 1/3] Documentation/git-svn: Promote the use of --prefix in docs + examples","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-10-11T12:57:05Z","receivedAt":"2013-10-11T12:57:05Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"Currently, the git-svn defaults to using an empty prefix, which ends\nup placing the SVN-tracking refs directly in refs/remotes/*. This\nplacement runs counter to Git's convention of placing remote-tracking\nbranches in refs/remotes/$remote/*.\n\nFurthermore, combining git-svn with \"regular\" Git remotes run the risk\nof clobbering refs under refs/remotes (e.g. if you have a git remote\ncalled \"tags\" with a \"v1\" branch, it will overlap with the git-svn's\ntracking branch for the \"v1\" tag from Subversion.\n\nEven though the git-svn refs stored in refs/remotes/* are not \"proper\"\nremote-tracking branches (since they are not covered by a proper git\nremote's refspec), they clearly represent a similar concept, and would\nbenefit from following the same convention.\n\nFor example, if git-svn tracks Subversion branch \"foo\" at\nrefs/remotes/foo, and you create a local branch refs/heads/foo to add\nsome commits to be pushed back to Subversion (using \"git svn dcommit),\nthen it is clearly unhelpful of Git to throw\n\n  warning: refname 'foo' is ambiguous.\n\nevery time you checkout, rebase, or otherwise interact with the branch.\n\nAt this time, the user is better off using the --prefix=foo/ (the\ntrailing slash is important) to git svn init/clone, to cause the\nSVN-tracking refs to be placed at refs/remotes/foo/* instead of\nrefs/remotes/*. This patch updates the documentation to encourage\nuse of --prefix.\n\nThis is also in preparation for changing the default value of --prefix\nat some point in the future.\n\nCc: Eric Wong <normalperson@yhbt.net>\nSigned-off-by: Johan Herland <johan@herland.net>\n---\n Documentation/git-svn.txt | 35 +++++++++++++++++++++++++----------\n 1 file changed, 25 insertions(+), 10 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 4dd3bcb..ac0c72f 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -79,8 +79,13 @@ COMMANDS\n \ttrailing slash, so be sure you include one in the\n \targument if that is what you want.  If --branches/-b is\n \tspecified, the prefix must include a trailing slash.\n-\tSetting a prefix is useful if you wish to track multiple\n-\tprojects that share a common repository.\n+\tSetting a prefix (with a trailing slash) is strongly\n+\tencouraged in any case, as your SVN-tracking refs will\n+\tthen be located at \"refs/remotes/$prefix/*\", which is\n+\tcompatible with Git's own remote-tracking ref layout\n+\t(refs/remotes/$remote/*). Setting a prefix is also useful\n+\tif you wish to track multiple projects that share a common\n+\trepository.\n --ignore-paths=<regex>;;\n \tWhen passed to 'init' or 'clone' this regular expression will\n \tbe preserved as a config key.  See 'fetch' for a description\n@@ -804,16 +809,16 @@ Tracking and contributing to an entire Subversion-managed project\n \n ------------------------------------------------------------------------\n # Clone a repo with standard SVN directory layout (like git clone):\n-\tgit svn clone http://svn.example.com/project --stdlayout\n+\tgit svn clone http://svn.example.com/project --stdlayout --prefix svn/\n # Or, if the repo uses a non-standard directory layout:\n-\tgit svn clone http://svn.example.com/project -T tr -b branch -t tag\n+\tgit svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/\n # View all branches and tags you have cloned:\n \tgit branch -r\n # Create a new branch in SVN\n     git svn branch waldo\n # Reset your master to trunk (or any other branch, replacing 'trunk'\n # with the appropriate name):\n-\tgit reset --hard remotes/trunk\n+\tgit reset --hard svn/trunk\n # You may only dcommit to one branch/tag/trunk at a time.  The usage\n # of dcommit/rebase/show-ignore should be the same as above.\n ------------------------------------------------------------------------\n@@ -827,7 +832,7 @@ have each person clone that repository with 'git clone':\n \n ------------------------------------------------------------------------\n # Do the initial import on a server\n-\tssh server \"cd /pub && git svn clone http://svn.example.com/project\n+\tssh server \"cd /pub && git svn clone http://svn.example.com/project [options...]\"\n # Clone locally - make sure the refs/remotes/ space matches the server\n \tmkdir project\n \tcd project\n@@ -840,8 +845,9 @@ have each person clone that repository with 'git clone':\n \tgit config --remove-section remote.origin\n # Create a local branch from one of the branches just fetched\n \tgit checkout -b master FETCH_HEAD\n-# Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)\n-\tgit svn init http://svn.example.com/project\n+# Initialize 'git svn' locally (be sure to use the same URL and\n+# --stdlayout/-T/-b/-t/--prefix options as were used on server)\n+\tgit svn init http://svn.example.com/project [options...]\n # Pull the latest changes from Subversion\n \tgit svn rebase\n ------------------------------------------------------------------------\n@@ -973,6 +979,15 @@ without giving any repository layout options.  If the full history with\n branches and tags is required, the options '--trunk' / '--branches' /\n '--tags' must be used.\n \n+When using the options for describing the repository layout (--trunk,\n+--tags, --branches, --stdlayout), please also specify the --prefix\n+option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be\n+placed at refs/remotes/origin/* rather than the default refs/remotes/*.\n+The former is more compatible with the layout of Git's \"regular\"\n+remote-tracking refs (refs/remotes/$remote/*), and may potentially\n+prevent similarly named SVN branches and Git remotes from clobbering\n+each other.\n+\n When using multiple --branches or --tags, 'git svn' does not automatically\n handle name collisions (for example, if two branches from different paths have\n the same name, or if a branch and a tag have the same name).  In these cases,\n@@ -1035,8 +1050,8 @@ comma-separated list of names within braces. For example:\n [svn-remote \"huge-project\"]\n \turl = http://server.org/svn\n \tfetch = trunk/src:refs/remotes/trunk\n-\tbranches = branches/{red,green}/src:refs/remotes/branches/*\n-\ttags = tags/{1.0,2.0}/src:refs/remotes/tags/*\n+\tbranches = branches/{red,green}/src:refs/remotes/project-a/branches/*\n+\ttags = tags/{1.0,2.0}/src:refs/remotes/project-a/tags/*\n ------------------------------------------------------------------------\n \n Multiple fetch, branches, and tags keys are supported:\n-- \n1.8.4.653.g2df02b3\n"},{"id":"228734","messageId":"1381496227-28700-3-git-send-email-johan@herland.net","threadId":"34745","inReplyTo":"1381496227-28700-1-git-send-email-johan@herland.net","subject":"[RFC/PATCHv3 2/3] git-svn: Warn about changing default for --prefix in Git v2.0","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-10-11T12:57:06Z","receivedAt":"2013-10-11T12:57:06Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"In Git v2.0, we will change the default --prefix for init/clone from\nnone/empty to \"origin/\" (which causes SVN-tracking branches to be\nplaced at refs/remotes/origin/* instead of refs/remotes/*).\n\nThis patch warns users about the upcoming change, both in the git-svn\nmanual page, and on stderr when running init/clone in the \"multi-mode\"\nwithout providing a --prefix.\n\nCc: Eric Wong <normalperson@yhbt.net>\nSigned-off-by: Johan Herland <johan@herland.net>\n---\n Documentation/git-svn.txt     | 11 ++++++-\n git-svn.perl                  | 12 +++++++-\n t/t9117-git-svn-init-clone.sh | 67 +++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 88 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex ac0c72f..7980c20 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -86,6 +86,14 @@ COMMANDS\n \t(refs/remotes/$remote/*). Setting a prefix is also useful\n \tif you wish to track multiple projects that share a common\n \trepository.\n++\n+NOTE: In Git v2.0, the default prefix will CHANGE from \"\" (no prefix)\n+to \"origin/\". This is done to put SVN-tracking refs at\n+\"refs/remotes/origin/*\" instead of \"refs/remotes/*\", and make them\n+more compatible with how Git's own remote-tracking refs are organized\n+(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,\n+by using the --prefix option.\n+\n --ignore-paths=<regex>;;\n \tWhen passed to 'init' or 'clone' this regular expression will\n \tbe preserved as a config key.  See 'fetch' for a description\n@@ -986,7 +994,8 @@ placed at refs/remotes/origin/* rather than the default refs/remotes/*.\n The former is more compatible with the layout of Git's \"regular\"\n remote-tracking refs (refs/remotes/$remote/*), and may potentially\n prevent similarly named SVN branches and Git remotes from clobbering\n-each other.\n+each other. In Git v2.0 the default prefix used (i.e. when no --prefix\n+is given) will change from \"\" (no prefix) to \"origin/\".\n \n When using multiple --branches or --tags, 'git svn' does not automatically\n handle name collisions (for example, if two branches from different paths have\ndiff --git a/git-svn.perl b/git-svn.perl\nindex ff1ce3d..0443a4f 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1389,7 +1389,17 @@ sub cmd_multi_init {\n \t\tusage(1);\n \t}\n \n-\t$_prefix = '' unless defined $_prefix;\n+\tunless (defined $_prefix) {\n+\t\t$_prefix = '';\n+\t\twarn <<EOF\n+WARNING: --prefix is not given, defaulting to empty prefix.\n+         This is probably not what you want! In order to stay compatible\n+         with regular remote-tracking refs, provide a prefix like\n+         --prefix=origin/ (remember the trailing slash), which will cause\n+         the SVN-tracking refs to be placed at refs/remotes/origin/*.\n+NOTE: In Git v2.0, the default prefix will change from empty to 'origin/'.\n+EOF\n+\t}\n \tif (defined $url) {\n \t\t$url = canonicalize_url($url);\n \t\tinit_subdir(@_);\ndiff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh\nindex b7ef9e2..69e9c0d 100755\n--- a/t/t9117-git-svn-init-clone.sh\n+++ b/t/t9117-git-svn-init-clone.sh\n@@ -52,4 +52,71 @@ test_expect_success 'clone to target directory with --stdlayout' '\n \trm -rf target\n \t'\n \n+test_expect_success 'init without -s/-T/-b/-t does not warn' '\n+\ttest ! -d trunk &&\n+\tgit svn init \"$svnrepo\"/project/trunk trunk 2>warning &&\n+\ttest_must_fail grep -q prefix warning &&\n+\trm -rf trunk &&\n+\trm -f warning\n+\t'\n+\n+test_expect_success 'clone without -s/-T/-b/-t does not warn' '\n+\ttest ! -d trunk &&\n+\tgit svn clone \"$svnrepo\"/project/trunk 2>warning &&\n+\ttest_must_fail grep -q prefix warning &&\n+\trm -rf trunk &&\n+\trm -f warning\n+\t'\n+\n+test_svn_configured_prefix () {\n+\tprefix=$1 &&\n+\tcat >expect <<EOF &&\n+project/trunk:refs/remotes/${prefix}trunk\n+project/branches/*:refs/remotes/${prefix}*\n+project/tags/*:refs/remotes/${prefix}tags/*\n+EOF\n+\ttest ! -f actual &&\n+\tgit --git-dir=project/.git config svn-remote.svn.fetch >>actual &&\n+\tgit --git-dir=project/.git config svn-remote.svn.branches >>actual &&\n+\tgit --git-dir=project/.git config svn-remote.svn.tags >>actual &&\n+\ttest_cmp expect actual &&\n+\trm -f expect actual\n+}\n+\n+test_expect_success 'init with -s/-T/-b/-t without --prefix warns' '\n+\ttest ! -d project &&\n+\tgit svn init -s \"$svnrepo\"/project project 2>warning &&\n+\tgrep -q prefix warning &&\n+\ttest_svn_configured_prefix \"\" &&\n+\trm -rf project &&\n+\trm -f warning\n+\t'\n+\n+test_expect_success 'clone with -s/-T/-b/-t without --prefix warns' '\n+\ttest ! -d project &&\n+\tgit svn clone -s \"$svnrepo\"/project 2>warning &&\n+\tgrep -q prefix warning &&\n+\ttest_svn_configured_prefix \"\" &&\n+\trm -rf project &&\n+\trm -f warning\n+\t'\n+\n+test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '\n+\ttest ! -d project &&\n+\tgit svn init -s \"$svnrepo\"/project project --prefix=\"\" 2>warning &&\n+\ttest_must_fail grep -q prefix warning &&\n+\ttest_svn_configured_prefix \"\" &&\n+\trm -rf project &&\n+\trm -f warning\n+\t'\n+\n+test_expect_success 'clone with -s/-T/-b/-t and --prefix does not warn' '\n+\ttest ! -d project &&\n+\tgit svn clone -s \"$svnrepo\"/project --prefix=\"\" 2>warning &&\n+\ttest_must_fail grep -q prefix warning &&\n+\ttest_svn_configured_prefix \"\" &&\n+\trm -rf project &&\n+\trm -f warning\n+\t'\n+\n test_done\n-- \n1.8.4.653.g2df02b3\n"},{"id":"228732","messageId":"1381496227-28700-4-git-send-email-johan@herland.net","threadId":"34745","inReplyTo":"1381496227-28700-1-git-send-email-johan@herland.net","subject":"[RFC/PATCHv3 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-10-11T12:57:07Z","receivedAt":"2013-10-11T12:57:07Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"git-svn by default puts its Subversion-tracking refs directly in\nrefs/remotes/*. This runs counter to Git's convention of using\nrefs/remotes/$remote/* for storing remote-tracking branches.\n\nFurthermore, combining git-svn with regular git remotes run the risk of\nclobbering refs under refs/remotes (e.g. if you have a git remote\ncalled \"tags\" with a \"v1\" branch, it will overlap with the git-svn's\ntracking branch for the \"v1\" tag from Subversion.\n\nEven though the git-svn refs stored in refs/remotes/* are not \"proper\"\nremote-tracking branches (since they are not covered by a proper git\nremote's refspec), they clearly represent a similar concept, and would\nbenefit from following the same convention.\n\nFor example, if git-svn tracks Subversion branch \"foo\" at\nrefs/remotes/foo, and you create a local branch refs/heads/foo to add\nsome commits to be pushed back to Subversion (using \"git svn dcommit),\nthen it is clearly unhelpful of Git to throw\n\n  warning: refname 'foo' is ambiguous.\n\nevery time you checkout, rebase, or otherwise interact with the branch.\n\nThe existing workaround for this is to supply the --prefix=quux/ to\ngit svn init/clone, so that git-svn's tracking branches end up in\nrefs/remotes/quux/* instead of refs/remotes/*. However, encouraging\nusers to specify --prefix to work around a design flaw in git-svn is\nsuboptimal, and not a long term solution to the problem. Instead,\ngit-svn should default to use a non-empty prefix that saves\nunsuspecting users from the inconveniences described above.\n\nThis patch will only affect newly created git-svn setups, as the\n--prefix option only applies to git svn init (and git svn clone).\nExisting git-svn setups will continue with their existing (lack of)\nprefix. Also, if anyone somehow prefers git-svn's old layout, they\ncan recreate that by explicitly passing an empty prefix (--prefix \"\")\non the git svn init/clone command line.\n\nThe patch changes the default value for --prefix from \"\" to \"origin/\",\nupdates the git-svn manual page, and fixes the fallout in the git-svn\ntestcases.\n\n(Note that this patch might be easier to review using the --word-diff\nand --word-diff-regex=. diff options.)\n\nSuggested-by: Thomas Ferris Nicolaisen <tfnico@gmail.com>\nCc: Eric Wong <normalperson@yhbt.net>\nSigned-off-by: Johan Herland <johan@herland.net>\n---\n Documentation/git-svn.txt                        | 19 +--------\n git-svn.perl                                     | 12 +-----\n t/t9107-git-svn-migrate.sh                       | 54 ++++++++++++------------\n t/t9114-git-svn-dcommit-merge.sh                 |  4 +-\n t/t9116-git-svn-log.sh                           | 46 ++++++++++----------\n t/t9117-git-svn-init-clone.sh                    | 16 +++----\n t/t9118-git-svn-funky-branch-names.sh            | 20 ++++-----\n t/t9120-git-svn-clone-with-percent-escapes.sh    | 14 +++---\n t/t9125-git-svn-multi-glob-branch-names.sh       |  6 +--\n t/t9128-git-svn-cmd-branch.sh                    | 18 ++++----\n t/t9135-git-svn-moved-branch-empty-file.sh       |  2 +-\n t/t9141-git-svn-multiple-branches.sh             | 28 ++++++------\n t/t9145-git-svn-master-branch.sh                 |  2 +-\n t/t9155-git-svn-fetch-deleted-tag.sh             |  4 +-\n t/t9156-git-svn-fetch-deleted-tag-2.sh           |  6 +--\n t/t9161-git-svn-mergeinfo-push.sh                | 22 +++++-----\n t/t9163-git-svn-reset-clears-caches.sh           |  4 +-\n t/t9165-git-svn-fetch-merge-branch-of-branch.sh  |  2 +-\n t/t9166-git-svn-fetch-merge-branch-of-branch2.sh |  2 +-\n t/t9167-git-svn-cmd-branch-subproject.sh         |  2 +-\n 20 files changed, 128 insertions(+), 155 deletions(-)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 7980c20..43da05a 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -86,14 +86,7 @@ COMMANDS\n \t(refs/remotes/$remote/*). Setting a prefix is also useful\n \tif you wish to track multiple projects that share a common\n \trepository.\n-+\n-NOTE: In Git v2.0, the default prefix will CHANGE from \"\" (no prefix)\n-to \"origin/\". This is done to put SVN-tracking refs at\n-\"refs/remotes/origin/*\" instead of \"refs/remotes/*\", and make them\n-more compatible with how Git's own remote-tracking refs are organized\n-(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,\n-by using the --prefix option.\n-\n+\tBy default, the prefix is set to 'origin/'.\n --ignore-paths=<regex>;;\n \tWhen passed to 'init' or 'clone' this regular expression will\n \tbe preserved as a config key.  See 'fetch' for a description\n@@ -987,16 +980,6 @@ without giving any repository layout options.  If the full history with\n branches and tags is required, the options '--trunk' / '--branches' /\n '--tags' must be used.\n \n-When using the options for describing the repository layout (--trunk,\n---tags, --branches, --stdlayout), please also specify the --prefix\n-option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be\n-placed at refs/remotes/origin/* rather than the default refs/remotes/*.\n-The former is more compatible with the layout of Git's \"regular\"\n-remote-tracking refs (refs/remotes/$remote/*), and may potentially\n-prevent similarly named SVN branches and Git remotes from clobbering\n-each other. In Git v2.0 the default prefix used (i.e. when no --prefix\n-is given) will change from \"\" (no prefix) to \"origin/\".\n-\n When using multiple --branches or --tags, 'git svn' does not automatically\n handle name collisions (for example, if two branches from different paths have\n the same name, or if a branch and a tag have the same name).  In these cases,\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 0443a4f..ad3fe66 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1389,17 +1389,7 @@ sub cmd_multi_init {\n \t\tusage(1);\n \t}\n \n-\tunless (defined $_prefix) {\n-\t\t$_prefix = '';\n-\t\twarn <<EOF\n-WARNING: --prefix is not given, defaulting to empty prefix.\n-         This is probably not what you want! In order to stay compatible\n-         with regular remote-tracking refs, provide a prefix like\n-         --prefix=origin/ (remember the trailing slash), which will cause\n-         the SVN-tracking refs to be placed at refs/remotes/origin/*.\n-NOTE: In Git v2.0, the default prefix will change from empty to 'origin/'.\n-EOF\n-\t}\n+\t$_prefix = 'origin/' unless defined $_prefix;\n \tif (defined $url) {\n \t\t$url = canonicalize_url($url);\n \t\tinit_subdir(@_);\ndiff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh\nindex ee73013..6e69fc4 100755\n--- a/t/t9107-git-svn-migrate.sh\n+++ b/t/t9107-git-svn-migrate.sh\n@@ -45,27 +45,27 @@ test_expect_success 'initialize old-style (v0) git svn layout' '\n test_expect_success 'initialize a multi-repository repo' '\n \tgit svn init \"$svnrepo\" -T trunk -t tags -b branches &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n-\tgrep \"^trunk:refs/remotes/trunk$\" fetch.out &&\n+\tgrep \"^trunk:refs/remotes/origin/trunk$\" fetch.out &&\n \ttest -n \"`git config --get svn-remote.svn.branches \\\n-\t            \"^branches/\\*:refs/remotes/\\*$\"`\" &&\n+\t            \"^branches/\\*:refs/remotes/origin/\\*$\"`\" &&\n \ttest -n \"`git config --get svn-remote.svn.tags \\\n-\t            \"^tags/\\*:refs/remotes/tags/\\*$\"`\" &&\n+\t            \"^tags/\\*:refs/remotes/origin/tags/\\*$\"`\" &&\n \tgit config --unset svn-remote.svn.branches \\\n-\t                        \"^branches/\\*:refs/remotes/\\*$\" &&\n+\t                        \"^branches/\\*:refs/remotes/origin/\\*$\" &&\n \tgit config --unset svn-remote.svn.tags \\\n-\t                        \"^tags/\\*:refs/remotes/tags/\\*$\" &&\n-\tgit config --add svn-remote.svn.fetch \"branches/a:refs/remotes/a\" &&\n-\tgit config --add svn-remote.svn.fetch \"branches/b:refs/remotes/b\" &&\n+\t                        \"^tags/\\*:refs/remotes/origin/tags/\\*$\" &&\n+\tgit config --add svn-remote.svn.fetch \"branches/a:refs/remotes/origin/a\" &&\n+\tgit config --add svn-remote.svn.fetch \"branches/b:refs/remotes/origin/b\" &&\n \tfor i in tags/0.1 tags/0.2 tags/0.3; do\n \t\tgit config --add svn-remote.svn.fetch \\\n-\t\t                 $i:refs/remotes/$i || exit 1; done &&\n+\t\t                 $i:refs/remotes/origin/$i || exit 1; done &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n-\tgrep \"^trunk:refs/remotes/trunk$\" fetch.out &&\n-\tgrep \"^branches/a:refs/remotes/a$\" fetch.out &&\n-\tgrep \"^branches/b:refs/remotes/b$\" fetch.out &&\n-\tgrep \"^tags/0\\.1:refs/remotes/tags/0\\.1$\" fetch.out &&\n-\tgrep \"^tags/0\\.2:refs/remotes/tags/0\\.2$\" fetch.out &&\n-\tgrep \"^tags/0\\.3:refs/remotes/tags/0\\.3$\" fetch.out &&\n+\tgrep \"^trunk:refs/remotes/origin/trunk$\" fetch.out &&\n+\tgrep \"^branches/a:refs/remotes/origin/a$\" fetch.out &&\n+\tgrep \"^branches/b:refs/remotes/origin/b$\" fetch.out &&\n+\tgrep \"^tags/0\\.1:refs/remotes/origin/tags/0\\.1$\" fetch.out &&\n+\tgrep \"^tags/0\\.2:refs/remotes/origin/tags/0\\.2$\" fetch.out &&\n+\tgrep \"^tags/0\\.3:refs/remotes/origin/tags/0\\.3$\" fetch.out &&\n \tgrep \"^:refs/${remotes_git_svn}\" fetch.out\n \t'\n \n@@ -73,14 +73,14 @@ test_expect_success 'initialize a multi-repository repo' '\n test_expect_success 'multi-fetch works on partial urls + paths' \"\n \tgit svn multi-fetch &&\n \tfor i in trunk a b tags/0.1 tags/0.2 tags/0.3; do\n-\t\tgit rev-parse --verify refs/remotes/\\$i^0 >> refs.out || exit 1;\n+\t\tgit rev-parse --verify refs/remotes/origin/\\$i^0 >> refs.out || exit 1;\n \t    done &&\n \ttest -z \\\"\\`sort < refs.out | uniq -d\\`\\\" &&\n \tfor i in trunk a b tags/0.1 tags/0.2 tags/0.3; do\n \t  for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do\n \t\tif test \\$j != \\$i; then continue; fi\n-\t    test -z \\\"\\`git diff refs/remotes/\\$i \\\n-\t                         refs/remotes/\\$j\\`\\\" ||exit 1; done; done\n+\t    test -z \\\"\\`git diff refs/remotes/origin/\\$i \\\n+\t                         refs/remotes/origin/\\$j\\`\\\" ||exit 1; done; done\n \t\"\n \n test_expect_success 'migrate --minimize on old inited layout' '\n@@ -98,27 +98,27 @@ test_expect_success 'migrate --minimize on old inited layout' '\n \tgit svn migrate --minimize &&\n \ttest -z \"`git config -l | grep \"^svn-remote\\.git-svn\\.\"`\" &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n-\tgrep \"^trunk:refs/remotes/trunk$\" fetch.out &&\n-\tgrep \"^branches/a:refs/remotes/a$\" fetch.out &&\n-\tgrep \"^branches/b:refs/remotes/b$\" fetch.out &&\n-\tgrep \"^tags/0\\.1:refs/remotes/tags/0\\.1$\" fetch.out &&\n-\tgrep \"^tags/0\\.2:refs/remotes/tags/0\\.2$\" fetch.out &&\n-\tgrep \"^tags/0\\.3:refs/remotes/tags/0\\.3$\" fetch.out &&\n+\tgrep \"^trunk:refs/remotes/origin/trunk$\" fetch.out &&\n+\tgrep \"^branches/a:refs/remotes/origin/a$\" fetch.out &&\n+\tgrep \"^branches/b:refs/remotes/origin/b$\" fetch.out &&\n+\tgrep \"^tags/0\\.1:refs/remotes/origin/tags/0\\.1$\" fetch.out &&\n+\tgrep \"^tags/0\\.2:refs/remotes/origin/tags/0\\.2$\" fetch.out &&\n+\tgrep \"^tags/0\\.3:refs/remotes/origin/tags/0\\.3$\" fetch.out &&\n \tgrep \"^:refs/${remotes_git_svn}\" fetch.out\n \t'\n \n test_expect_success  \".rev_db auto-converted to .rev_map.UUID\" '\n \tgit svn fetch -i trunk &&\n-\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)\" &&\n-\texpect=\"$(ls \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_map.*)\" &&\n+\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)\" &&\n+\texpect=\"$(ls \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_map.*)\" &&\n \ttest -n \"$expect\" &&\n \trev_db=\"$(echo $expect | sed -e \"s,_map,_db,\")\" &&\n \tconvert_to_rev_db \"$expect\" \"$rev_db\" &&\n \trm -f \"$expect\" &&\n \ttest -f \"$rev_db\" &&\n \tgit svn fetch -i trunk &&\n-\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_db.* 2>/dev/null)\" &&\n-\ttest ! -e \"$GIT_DIR\"/svn/refs/remotes/trunk/.rev_db &&\n+\ttest -z \"$(ls \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_db.* 2>/dev/null)\" &&\n+\ttest ! -e \"$GIT_DIR\"/svn/refs/remotes/origin/trunk/.rev_db &&\n \ttest -f \"$expect\"\n \t'\n \ndiff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\nindex f524d2f..6f0968a 100755\n--- a/t/t9114-git-svn-dcommit-merge.sh\n+++ b/t/t9114-git-svn-dcommit-merge.sh\n@@ -48,7 +48,7 @@ test_expect_success 'setup svn repository' '\n test_expect_success 'setup git mirror and merge' '\n \tgit svn init \"$svnrepo\" -t tags -T trunk -b branches &&\n \tgit svn fetch &&\n-\tgit checkout -b svn remotes/trunk &&\n+\tgit checkout -b svn remotes/origin/trunk &&\n \tgit checkout -b merge &&\n \techo new file > new_file &&\n \tgit add new_file &&\n@@ -81,7 +81,7 @@ test_debug 'gitk --all & sleep 1'\n \n test_expect_success 'verify post-merge ancestry' \"\n \ttest x\\`git rev-parse --verify refs/heads/svn\\` = \\\n-\t     x\\`git rev-parse --verify refs/remotes/trunk \\` &&\n+\t     x\\`git rev-parse --verify refs/remotes/origin/trunk \\` &&\n \ttest x\\`git rev-parse --verify refs/heads/svn^2\\` = \\\n \t     x\\`git rev-parse --verify refs/heads/merge\\` &&\n \tgit cat-file commit refs/heads/svn^ | grep '^friend$'\ndiff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh\nindex cf4c052..45773ee 100755\n--- a/t/t9116-git-svn-log.sh\n+++ b/t/t9116-git-svn-log.sh\n@@ -20,20 +20,20 @@ test_expect_success 'setup repository and import' '\n \t) &&\n \tgit svn init \"$svnrepo\" -T trunk -b branches -t tags &&\n \tgit svn fetch &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \techo bye >> README &&\n \tgit commit -a -m bye &&\n \tgit svn dcommit &&\n-\tgit reset --hard a &&\n+\tgit reset --hard origin/a &&\n \techo why >> FEEDME &&\n \tgit update-index --add FEEDME &&\n \tgit commit -m feedme &&\n \tgit svn dcommit &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \techo aye >> README &&\n \tgit commit -a -m aye &&\n \tgit svn dcommit &&\n-\tgit reset --hard b &&\n+\tgit reset --hard origin/b &&\n \techo spy >> README &&\n \tgit commit -a -m spy &&\n \techo try >> README &&\n@@ -42,26 +42,26 @@ test_expect_success 'setup repository and import' '\n \t'\n \n test_expect_success 'run log' \"\n-\tgit reset --hard a &&\n-\tgit svn log -r2 trunk | grep ^r2 &&\n-\tgit svn log -r4 trunk | grep ^r4 &&\n+\tgit reset --hard origin/a &&\n+\tgit svn log -r2 origin/trunk | grep ^r2 &&\n+\tgit svn log -r4 origin/trunk | grep ^r4 &&\n \tgit svn log -r3 | grep ^r3\n \t\"\n \n test_expect_success 'run log against a from trunk' \"\n-\tgit reset --hard trunk &&\n-\tgit svn log -r3 a | grep ^r3\n+\tgit reset --hard origin/trunk &&\n+\tgit svn log -r3 origin/a | grep ^r3\n \t\"\n \n printf 'r1 \\nr2 \\nr4 \\n' > expected-range-r1-r2-r4\n \n test_expect_success 'test ascending revision range' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -\n \t\"\n \n test_expect_success 'test ascending revision range with --show-commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -\n \t\"\n \n@@ -69,7 +69,7 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' \"\n \tgit svn find-rev r1 >expected-range-r1-r2-r4-sha1 &&\n \tgit svn find-rev r2 >>expected-range-r1-r2-r4-sha1 &&\n \tgit svn find-rev r4 >>expected-range-r1-r2-r4-sha1 &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log --show-commit -r 1:4 | grep '^r[0-9]' | cut -d'|' -f2 >out &&\n \tgit rev-parse \\$(cat out) >actual &&\n \ttest_cmp expected-range-r1-r2-r4-sha1 actual\n@@ -78,67 +78,67 @@ test_expect_success 'test ascending revision range with --show-commit (sha1)' \"\n printf 'r4 \\nr2 \\nr1 \\n' > expected-range-r4-r2-r1\n \n test_expect_success 'test descending revision range' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 4:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4-r2-r1 -\n \t\"\n \n printf 'r1 \\nr2 \\n' > expected-range-r1-r2\n \n test_expect_success 'test ascending revision range with unreachable revision' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 1:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2 -\n \t\"\n \n printf 'r2 \\nr1 \\n' > expected-range-r2-r1\n \n test_expect_success 'test descending revision range with unreachable revision' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:1 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2-r1 -\n \t\"\n \n printf 'r2 \\n' > expected-range-r2\n \n test_expect_success 'test ascending revision range with unreachable upper boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 2:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable upper boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:2 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r2 -\n \t\"\n \n printf 'r4 \\n' > expected-range-r4\n \n test_expect_success 'test ascending revision range with unreachable lower boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable lower boundary revision and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 4:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \n printf -- '------------------------------------------------------------------------\\n' > expected-separator\n \n test_expect_success 'test ascending revision range with unreachable boundary revisions and no commits' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 5:6 | test_cmp expected-separator -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable boundary revisions and no commits' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 6:5 | test_cmp expected-separator -\n \t\"\n \n test_expect_success 'test ascending revision range with unreachable boundary revisions and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 3:5 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \n test_expect_success 'test descending revision range with unreachable boundary revisions and 1 commit' \"\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn log -r 5:3 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r4 -\n \t\"\n \ndiff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh\nindex 69e9c0d..dfed76f 100755\n--- a/t/t9117-git-svn-init-clone.sh\n+++ b/t/t9117-git-svn-init-clone.sh\n@@ -83,25 +83,25 @@ EOF\n \trm -f expect actual\n }\n \n-test_expect_success 'init with -s/-T/-b/-t without --prefix warns' '\n+test_expect_success 'init with -s/-T/-b/-t assumes --prefix=origin/' '\n \ttest ! -d project &&\n \tgit svn init -s \"$svnrepo\"/project project 2>warning &&\n-\tgrep -q prefix warning &&\n-\ttest_svn_configured_prefix \"\" &&\n+\ttest_must_fail grep -q prefix warning &&\n+\ttest_svn_configured_prefix \"origin/\" &&\n \trm -rf project &&\n \trm -f warning\n \t'\n \n-test_expect_success 'clone with -s/-T/-b/-t without --prefix warns' '\n+test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' '\n \ttest ! -d project &&\n \tgit svn clone -s \"$svnrepo\"/project 2>warning &&\n-\tgrep -q prefix warning &&\n-\ttest_svn_configured_prefix \"\" &&\n+\ttest_must_fail grep -q prefix warning &&\n+\ttest_svn_configured_prefix \"origin/\" &&\n \trm -rf project &&\n \trm -f warning\n \t'\n \n-test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '\n+test_expect_success 'init with -s/-T/-b/-t and --prefix=\"\" still works' '\n \ttest ! -d project &&\n \tgit svn init -s \"$svnrepo\"/project project --prefix=\"\" 2>warning &&\n \ttest_must_fail grep -q prefix warning &&\n@@ -110,7 +110,7 @@ test_expect_success 'init with -s/-T/-b/-t and --prefix does not warn' '\n \trm -f warning\n \t'\n \n-test_expect_success 'clone with -s/-T/-b/-t and --prefix does not warn' '\n+test_expect_success 'clone with -s/-T/-b/-t and --prefix=\"\" still works' '\n \ttest ! -d project &&\n \tgit svn clone -s \"$svnrepo\"/project --prefix=\"\" 2>warning &&\n \ttest_must_fail grep -q prefix warning &&\ndiff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh\nindex 15f93b4..ed4d136 100755\n--- a/t/t9118-git-svn-funky-branch-names.sh\n+++ b/t/t9118-git-svn-funky-branch-names.sh\n@@ -41,20 +41,20 @@ test_expect_success 'test clone with funky branch names' '\n \tgit svn clone -s \"$svnrepo/pr ject\" project &&\n \t(\n \t\tcd project &&\n-\t\tgit rev-parse \"refs/remotes/fun%20plugin\" &&\n-\t\tgit rev-parse \"refs/remotes/more%20fun%20plugin!\" &&\n-\t\tgit rev-parse \"refs/remotes/$scary_ref\" &&\n-\t\tgit rev-parse \"refs/remotes/%2Eleading_dot\" &&\n-\t\tgit rev-parse \"refs/remotes/trailing_dot%2E\" &&\n-\t\tgit rev-parse \"refs/remotes/trailing_dotlock%2Elock\" &&\n-\t\tgit rev-parse \"refs/remotes/$non_reflog\"\n+\t\tgit rev-parse \"refs/remotes/origin/fun%20plugin\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/more%20fun%20plugin!\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/$scary_ref\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/%2Eleading_dot\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/trailing_dot%2E\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/trailing_dotlock%2Elock\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/$non_reflog\"\n \t)\n \t'\n \n test_expect_success 'test dcommit to funky branch' \"\n \t(\n \t\tcd project &&\n-\t\tgit reset --hard 'refs/remotes/more%20fun%20plugin!' &&\n+\t\tgit reset --hard 'refs/remotes/origin/more%20fun%20plugin!' &&\n \t\techo hello >> foo &&\n \t\tgit commit -m 'hello' -- foo &&\n \t\tgit svn dcommit\n@@ -64,7 +64,7 @@ test_expect_success 'test dcommit to funky branch' \"\n test_expect_success 'test dcommit to scary branch' '\n \t(\n \t\tcd project &&\n-\t\tgit reset --hard \"refs/remotes/$scary_ref\" &&\n+\t\tgit reset --hard \"refs/remotes/origin/$scary_ref\" &&\n \t\techo urls are scary >> foo &&\n \t\tgit commit -m \"eep\" -- foo &&\n \t\tgit svn dcommit\n@@ -74,7 +74,7 @@ test_expect_success 'test dcommit to scary branch' '\n test_expect_success 'test dcommit to trailing_dotlock branch' '\n \t(\n \t\tcd project &&\n-\t\tgit reset --hard \"refs/remotes/trailing_dotlock%2Elock\" &&\n+\t\tgit reset --hard \"refs/remotes/origin/trailing_dotlock%2Elock\" &&\n \t\techo who names branches like this anyway? >> foo &&\n \t\tgit commit -m \"bar\" -- foo &&\n \t\tgit svn dcommit\ndiff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh\nindex 1d92c05..1c84ce1 100755\n--- a/t/t9120-git-svn-clone-with-percent-escapes.sh\n+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh\n@@ -58,19 +58,19 @@ test_expect_success 'test clone --stdlayout with percent escapes' '\n \tgit svn clone --stdlayout \"$svnrepo/pr%20ject\" percent &&\n \t(\n \t\tcd percent &&\n-\t\tgit rev-parse refs/remotes/trunk^0 &&\n-\t\tgit rev-parse refs/remotes/b^0 &&\n-\t\tgit rev-parse refs/remotes/tags/v1^0\n+\t\tgit rev-parse refs/remotes/origin/trunk^0 &&\n+\t\tgit rev-parse refs/remotes/origin/b^0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v1^0\n \t)\n '\n \n test_expect_success 'test clone -s with unescaped space' '\n-\tgit svn clone -s \"$svnrepo/pr ject\" space &&\n+\tgit svn clone -s \"$svnrepo/pr ject\" --prefix origin/ space &&\n \t(\n \t\tcd space &&\n-\t\tgit rev-parse refs/remotes/trunk^0 &&\n-\t\tgit rev-parse refs/remotes/b^0 &&\n-\t\tgit rev-parse refs/remotes/tags/v1^0\n+\t\tgit rev-parse refs/remotes/origin/trunk^0 &&\n+\t\tgit rev-parse refs/remotes/origin/b^0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v1^0\n \t)\n '\n \ndiff --git a/t/t9125-git-svn-multi-glob-branch-names.sh b/t/t9125-git-svn-multi-glob-branch-names.sh\nindex 096abd1..0d53fc9 100755\n--- a/t/t9125-git-svn-multi-glob-branch-names.sh\n+++ b/t/t9125-git-svn-multi-glob-branch-names.sh\n@@ -20,14 +20,14 @@ test_expect_success 'test clone with multi-glob in branch names' '\n \tgit svn clone -T trunk -b branches/*/* -t tags \\\n \t              \"$svnrepo/project\" project &&\n \t(cd project &&\n-\t\tgit rev-parse \"refs/remotes/v14.1/beta\" &&\n-\t\tgit rev-parse \"refs/remotes/v14.1/gold\"\n+\t\tgit rev-parse \"refs/remotes/origin/v14.1/beta\" &&\n+\t\tgit rev-parse \"refs/remotes/origin/v14.1/gold\"\n \t)\n \t'\n \n test_expect_success 'test dcommit to multi-globbed branch' \"\n \t(cd project &&\n-\tgit reset --hard 'refs/remotes/v14.1/gold' &&\n+\tgit reset --hard 'refs/remotes/origin/v14.1/gold' &&\n \techo hello >> foo &&\n \tgit commit -m 'hello' -- foo &&\n \tgit svn dcommit\ndiff --git a/t/t9128-git-svn-cmd-branch.sh b/t/t9128-git-svn-cmd-branch.sh\nindex 4b034a6..4e95f79 100755\n--- a/t/t9128-git-svn-cmd-branch.sh\n+++ b/t/t9128-git-svn-cmd-branch.sh\n@@ -29,30 +29,30 @@ test_expect_success 'initialize svnrepo' '\n test_expect_success 'import into git' '\n \tgit svn init --stdlayout \"$svnrepo\" &&\n \tgit svn fetch &&\n-\tgit checkout remotes/trunk\n+\tgit checkout remotes/origin/trunk\n '\n \n test_expect_success 'git svn branch tests' '\n \tgit svn branch a &&\n \tbase=$(git rev-parse HEAD:) &&\n-\ttest $base = $(git rev-parse remotes/a:) &&\n+\ttest $base = $(git rev-parse remotes/origin/a:) &&\n \tgit svn branch -m \"created branch b blah\" b &&\n-\ttest $base = $(git rev-parse remotes/b:) &&\n+\ttest $base = $(git rev-parse remotes/origin/b:) &&\n \ttest_must_fail git branch -m \"no branchname\" &&\n \tgit svn branch -n c &&\n-\ttest_must_fail git rev-parse remotes/c &&\n+\ttest_must_fail git rev-parse remotes/origin/c &&\n \ttest_must_fail git svn branch a &&\n \tgit svn branch -t tag1 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag1:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag1:) &&\n \tgit svn branch --tag tag2 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag2:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag2:) &&\n \tgit svn tag tag3 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag3:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag3:) &&\n \tgit svn tag -m \"created tag4 foo\" tag4 &&\n-\ttest $base = $(git rev-parse remotes/tags/tag4:) &&\n+\ttest $base = $(git rev-parse remotes/origin/tags/tag4:) &&\n \ttest_must_fail git svn tag -m \"no tagname\" &&\n \tgit svn tag -n tag5 &&\n-\ttest_must_fail git rev-parse remotes/tags/tag5 &&\n+\ttest_must_fail git rev-parse remotes/origin/tags/tag5 &&\n \ttest_must_fail git svn tag tag1\n '\n \ndiff --git a/t/t9135-git-svn-moved-branch-empty-file.sh b/t/t9135-git-svn-moved-branch-empty-file.sh\nindex 5280e5f..93db45d 100755\n--- a/t/t9135-git-svn-moved-branch-empty-file.sh\n+++ b/t/t9135-git-svn-moved-branch-empty-file.sh\n@@ -12,7 +12,7 @@ test_expect_success 'clone using git svn' 'git svn clone -s \"$svnrepo\" x'\n test_expect_success 'test that b1 exists and is empty' '\n \t(\n \t\tcd x &&\n-\t\tgit reset --hard branch-c &&\n+\t\tgit reset --hard origin/branch-c &&\n \t\ttest -f b1 &&\n \t\t! test -s b1\n \t)\ndiff --git a/t/t9141-git-svn-multiple-branches.sh b/t/t9141-git-svn-multiple-branches.sh\nindex 3cd0671..8e7f7d6 100755\n--- a/t/t9141-git-svn-multiple-branches.sh\n+++ b/t/t9141-git-svn-multiple-branches.sh\n@@ -66,18 +66,18 @@ test_expect_success 'clone multiple branch and tag paths' '\n \t\t      -t tags_A/* --tags tags_B \\\n \t\t      \"$svnrepo/project\" git_project &&\n \t( cd git_project &&\n-\t\tgit rev-parse refs/remotes/first &&\n-\t\tgit rev-parse refs/remotes/second &&\n-\t\tgit rev-parse refs/remotes/1 &&\n-\t\tgit rev-parse refs/remotes/2 &&\n-\t\tgit rev-parse refs/remotes/tags/1.0 &&\n-\t\tgit rev-parse refs/remotes/tags/2.0 &&\n-\t\tgit rev-parse refs/remotes/tags/3.0 &&\n-\t\tgit rev-parse refs/remotes/tags/4.0 &&\n-\t\tgit rev-parse refs/remotes/tags/v5 &&\n-\t\tgit rev-parse refs/remotes/tags/v6 &&\n-\t\tgit rev-parse refs/remotes/tags/v7 &&\n-\t\tgit rev-parse refs/remotes/tags/v8\n+\t\tgit rev-parse refs/remotes/origin/first &&\n+\t\tgit rev-parse refs/remotes/origin/second &&\n+\t\tgit rev-parse refs/remotes/origin/1 &&\n+\t\tgit rev-parse refs/remotes/origin/2 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/1.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/2.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/3.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/4.0 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v5 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v6 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v7 &&\n+\t\tgit rev-parse refs/remotes/origin/tags/v8\n \t)\n '\n \n@@ -85,8 +85,8 @@ test_expect_success 'Multiple branch or tag paths require -d' '\n \t( cd git_project &&\n \t\ttest_must_fail git svn branch -m \"No new branch\" Nope &&\n \t\ttest_must_fail git svn tag -m \"No new tag\" Tagless &&\n-\t\ttest_must_fail git rev-parse refs/remotes/Nope &&\n-\t\ttest_must_fail git rev-parse refs/remotes/tags/Tagless\n+\t\ttest_must_fail git rev-parse refs/remotes/origin/Nope &&\n+\t\ttest_must_fail git rev-parse refs/remotes/origin/tags/Tagless\n \t) &&\n \t( cd svn_project &&\n \t\tsvn_cmd up &&\ndiff --git a/t/t9145-git-svn-master-branch.sh b/t/t9145-git-svn-master-branch.sh\nindex 16852d2..6559137 100755\n--- a/t/t9145-git-svn-master-branch.sh\n+++ b/t/t9145-git-svn-master-branch.sh\n@@ -17,7 +17,7 @@ test_expect_success 'git svn clone --stdlayout sets up trunk as master' '\n \tgit svn clone -s \"$svnrepo\" g &&\n \t(\n \t\tcd g &&\n-\t\ttest x`git rev-parse --verify refs/remotes/trunk^0` = \\\n+\t\ttest x`git rev-parse --verify refs/remotes/origin/trunk^0` = \\\n \t\t     x`git rev-parse --verify refs/heads/master^0`\n \t)\n '\ndiff --git a/t/t9155-git-svn-fetch-deleted-tag.sh b/t/t9155-git-svn-fetch-deleted-tag.sh\nindex a486a98..184336f 100755\n--- a/t/t9155-git-svn-fetch-deleted-tag.sh\n+++ b/t/t9155-git-svn-fetch-deleted-tag.sh\n@@ -35,8 +35,8 @@ test_expect_success 'fetch deleted tags from same revision with checksum error'\n \tcd git_project &&\n \tgit svn fetch &&\n \n-\tgit diff --exit-code mybranch:trunk/subdir/file tags/mytag:file &&\n-\tgit diff --exit-code master:subdir/file tags/mytag^:file\n+\tgit diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file &&\n+\tgit diff --exit-code master:subdir/file origin/tags/mytag^:file\n '\n \n test_done\ndiff --git a/t/t9156-git-svn-fetch-deleted-tag-2.sh b/t/t9156-git-svn-fetch-deleted-tag-2.sh\nindex 5ce7e2f..7a6e33b 100755\n--- a/t/t9156-git-svn-fetch-deleted-tag-2.sh\n+++ b/t/t9156-git-svn-fetch-deleted-tag-2.sh\n@@ -36,9 +36,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro\n \tcd git_project &&\n \tgit svn fetch &&\n \n-\tgit diff --exit-code master:subdir3/file tags/mytag:file &&\n-\tgit diff --exit-code master:subdir2/file tags/mytag^:file &&\n-\tgit diff --exit-code master:subdir1/file tags/mytag^^:file\n+\tgit diff --exit-code master:subdir3/file origin/tags/mytag:file &&\n+\tgit diff --exit-code master:subdir2/file origin/tags/mytag^:file &&\n+\tgit diff --exit-code master:subdir1/file origin/tags/mytag^^:file\n '\n \n test_done\ndiff --git a/t/t9161-git-svn-mergeinfo-push.sh b/t/t9161-git-svn-mergeinfo-push.sh\nindex 1eab701..6cb0909 100755\n--- a/t/t9161-git-svn-mergeinfo-push.sh\n+++ b/t/t9161-git-svn-mergeinfo-push.sh\n@@ -18,8 +18,8 @@ test_expect_success 'load svn dump' \"\n \n test_expect_success 'propagate merge information' '\n \tgit config svn.pushmergeinfo yes &&\n-\tgit checkout svnb1 &&\n-\tgit merge --no-ff svnb2 &&\n+\tgit checkout origin/svnb1 &&\n+\tgit merge --no-ff origin/svnb2 &&\n \tgit svn dcommit\n \t'\n \n@@ -29,7 +29,7 @@ test_expect_success 'check svn:mergeinfo' '\n \t'\n \n test_expect_success 'merge another branch' '\n-\tgit merge --no-ff svnb3 &&\n+\tgit merge --no-ff origin/svnb3 &&\n \tgit svn dcommit\n \t'\n \n@@ -40,7 +40,7 @@ test_expect_success 'check primary parent mergeinfo respected' '\n \t'\n \n test_expect_success 'merge existing merge' '\n-\tgit merge --no-ff svnb4 &&\n+\tgit merge --no-ff origin/svnb4 &&\n \tgit svn dcommit\n \t'\n \n@@ -53,7 +53,7 @@ test_expect_success \"check both parents' mergeinfo respected\" '\n \t'\n \n test_expect_success 'make further commits to branch' '\n-\tgit checkout svnb2 &&\n+\tgit checkout origin/svnb2 &&\n \ttouch newb2file &&\n \tgit add newb2file &&\n \tgit commit -m \"later b2 commit\" &&\n@@ -64,8 +64,8 @@ test_expect_success 'make further commits to branch' '\n \t'\n \n test_expect_success 'second forward merge' '\n-\tgit checkout svnb1 &&\n-\tgit merge --no-ff svnb2 &&\n+\tgit checkout origin/svnb1 &&\n+\tgit merge --no-ff origin/svnb2 &&\n \tgit svn dcommit\n \t'\n \n@@ -78,8 +78,8 @@ test_expect_success 'check new mergeinfo added' '\n \t'\n \n test_expect_success 'reintegration merge' '\n-\tgit checkout svnb4 &&\n-\tgit merge --no-ff svnb1 &&\n+\tgit checkout origin/svnb4 &&\n+\tgit merge --no-ff origin/svnb1 &&\n \tgit svn dcommit\n \t'\n \n@@ -92,11 +92,11 @@ test_expect_success 'check reintegration mergeinfo' '\n \t'\n \n test_expect_success 'dcommit a merge at the top of a stack' '\n-\tgit checkout svnb1 &&\n+\tgit checkout origin/svnb1 &&\n \ttouch anotherfile &&\n \tgit add anotherfile &&\n \tgit commit -m \"a commit\" &&\n-\tgit merge svnb4 &&\n+\tgit merge origin/svnb4 &&\n \tgit svn dcommit\n \t'\n \ndiff --git a/t/t9163-git-svn-reset-clears-caches.sh b/t/t9163-git-svn-reset-clears-caches.sh\nindex cd4c662..d6245ce 100755\n--- a/t/t9163-git-svn-reset-clears-caches.sh\n+++ b/t/t9163-git-svn-reset-clears-caches.sh\n@@ -70,9 +70,9 @@ test_expect_success 'rebase looses SVN merge (m)' '\n #\n test_expect_success 'reset and fetch gets the SVN merge (m) correctly' '\n \tgit svn reset -r 3 &&\n-\tgit reset --hard trunk &&\n+\tgit reset --hard origin/trunk &&\n \tgit svn fetch &&\n-\ttest 2 = $(git cat-file -p trunk|grep parent|wc -l)\n+\ttest 2 = $(git cat-file -p origin/trunk|grep parent|wc -l)\n '\n \n test_done\ndiff --git a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh\nindex 13ae7e3..fa3ef3b 100755\n--- a/t/t9165-git-svn-fetch-merge-branch-of-branch.sh\n+++ b/t/t9165-git-svn-fetch-merge-branch-of-branch.sh\n@@ -53,7 +53,7 @@ test_expect_success 'clone svn repo' '\n '\n \n test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&\n-\ty=$(git rev-parse branch2) &&\n+\ty=$(git rev-parse origin/branch2) &&\n \ttest \"x$x\" = \"x$y\"\n '\n \ndiff --git a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh\nindex af0ec0e..52f2e46 100755\n--- a/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh\n+++ b/t/t9166-git-svn-fetch-merge-branch-of-branch2.sh\n@@ -46,7 +46,7 @@ test_expect_success 'clone svn repo' '\n '\n \n test_expect_success 'verify merge commit' 'x=$(git rev-parse HEAD^2) &&\n-\ty=$(git rev-parse branch2) &&\n+\ty=$(git rev-parse origin/branch2) &&\n \ttest \"x$x\" = \"x$y\"\n '\n \ndiff --git a/t/t9167-git-svn-cmd-branch-subproject.sh b/t/t9167-git-svn-cmd-branch-subproject.sh\nindex 53def87..ba35fc0 100755\n--- a/t/t9167-git-svn-cmd-branch-subproject.sh\n+++ b/t/t9167-git-svn-cmd-branch-subproject.sh\n@@ -31,7 +31,7 @@ test_expect_success 'import into git' '\n \tgit svn init --trunk=trunk/project --branches=branches/*/project \\\n \t\t--tags=tags/*/project \"$svnrepo\" &&\n \tgit svn fetch &&\n-\tgit checkout remotes/trunk\n+\tgit checkout remotes/origin/trunk\n '\n \n test_expect_success 'git svn branch tests' '\n-- \n1.8.4.653.g2df02b3\n"},{"id":"228892","messageId":"20131012223357.GA4344@dcvr.yhbt.net","threadId":"34745","inReplyTo":"1381496227-28700-3-git-send-email-johan@herland.net","subject":"Re: [RFC/PATCHv3 2/3] git-svn: Warn about changing default for --prefix in Git v2.0","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2013-10-12T22:33:57Z","receivedAt":"2013-10-12T22:33:57Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Johan Herland <johan@herland.net> wrote:\n> In Git v2.0, we will change the default --prefix for init/clone from\n> none/empty to \"origin/\" (which causes SVN-tracking branches to be\n> placed at refs/remotes/origin/* instead of refs/remotes/*).\n> \n> This patch warns users about the upcoming change, both in the git-svn\n> manual page, and on stderr when running init/clone in the \"multi-mode\"\n> without providing a --prefix.\n> \n> Cc: Eric Wong <normalperson@yhbt.net>\n> Signed-off-by: Johan Herland <johan@herland.net>\n\nThanks!\n\n1/2 and 2/3 signed-off and pushed to git://git.bogomips.org/git-svn.git\n"},{"id":"239106","messageId":"20140419083210.GA28771@dcvr.yhbt.net","threadId":"34745","inReplyTo":"1381496227-28700-4-git-send-email-johan@herland.net","subject":"Re: [RFC/PATCHv3 3/3] Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2014-04-19T08:32:10Z","receivedAt":"2014-04-19T08:32:10Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Johan Herland <johan@herland.net> wrote:\n> --- a/Documentation/git-svn.txt\n> +++ b/Documentation/git-svn.txt\n> @@ -86,14 +86,7 @@ COMMANDS\n>  \t(refs/remotes/$remote/*). Setting a prefix is also useful\n>  \tif you wish to track multiple projects that share a common\n>  \trepository.\n> -+\n> -NOTE: In Git v2.0, the default prefix will CHANGE from \"\" (no prefix)\n> -to \"origin/\". This is done to put SVN-tracking refs at\n> -\"refs/remotes/origin/*\" instead of \"refs/remotes/*\", and make them\n> -more compatible with how Git's own remote-tracking refs are organized\n> -(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,\n> -by using the --prefix option.\n> -\n> +\tBy default, the prefix is set to 'origin/'.\n\nWe should maintain a description of <=1.9 behavior in the manpage.\nUsers on long-term-support systems are likely to continue using ancient\ngit installations for some time (5-10 years, even?), but may come across\nthe current documentation online.\n\nOtherwise the patch looks fine and I can push it up for Junio for\n2.0-rc1.\n"},{"id":"239108","messageId":"1397898631-1585-1-git-send-email-johan@herland.net","threadId":"34745","inReplyTo":"20140419083210.GA28771@dcvr.yhbt.net","subject":"[PATCH] git-svn.txt: Retain a description og pre-v2.0 default prefix","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2014-04-19T09:10:31Z","receivedAt":"2014-04-19T09:10:31Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"Add a description of <=1.9 behavior in the manpage. Users on\nlong-term-support systems are likely to continue using ancient\ngit installations for some time (5-10 years, even?), but may\ncome across the current documentation online.\n\nSuggested-by: Eric Wong <normalperson@yhbt.net>\nSigned-off-by: Johan Herland <johan@herland.net>\n---\n\n> We should maintain a description of <=1.9 behavior in the manpage.\n> Users on long-term-support systems are likely to continue using ancient\n> git installations for some time (5-10 years, even?), but may come across\n> the current documentation online.\n\nFeel free to add/squash this on top.\n\n> Otherwise the patch looks fine and I can push it up for Junio for\n> 2.0-rc1.\n\nThanks!\n\n...Johan\n\n Documentation/git-svn.txt | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex 3a7dd80..5b3c38d 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -87,6 +87,11 @@ COMMANDS\n \tif you wish to track multiple projects that share a common\n \trepository.\n \tBy default, the prefix is set to 'origin/'.\n++\n+NOTE: Before Git v2.0, the default prefix was \"\" (no prefix). This\n+meant that SVN-tracking refs were put at \"refs/remotes/*\", which is\n+incompatible with how Git's own remote-tracking refs are organized.\n+\n --ignore-paths=<regex>;;\n \tWhen passed to 'init' or 'clone' this regular expression will\n \tbe preserved as a config key.  See 'fetch' for a description\n-- \n1.9.1.587.g6ba9303\n"},{"id":"239110","messageId":"20140419114318.GA18939@dcvr.yhbt.net","threadId":"34745","inReplyTo":"1397898631-1585-1-git-send-email-johan@herland.net","subject":"Re: [PATCH] git-svn.txt: Retain a description og pre-v2.0 default prefix","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2014-04-19T11:43:18Z","receivedAt":"2014-04-19T11:43:18Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Johan Herland <johan@herland.net> wrote:\n> Feel free to add/squash this on top.\n\nThanks!  Squashed and pushed.\n\nThe following changes since commit cc291953df19aa4a97bee3590e708dc1fc557500:\n\n  Git 2.0-rc0 (2014-04-18 11:21:43 -0700)\n\nare available in the git repository at:\n\n  git://bogomips.org/git-svn.git master\n\nfor you to fetch changes up to fe191fcaa58cb785c804465a0da9bcba9fd9e822:\n\n  Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given (2014-04-19 11:30:13 +0000)\n\n----------------------------------------------------------------\nJohan Herland (1):\n      Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given\n\n Documentation/git-svn.txt                        | 20 ++-------\n git-svn.perl                                     | 12 +-----\n t/t9107-git-svn-migrate.sh                       | 54 ++++++++++++------------\n t/t9114-git-svn-dcommit-merge.sh                 |  4 +-\n t/t9116-git-svn-log.sh                           | 46 ++++++++++----------\n t/t9117-git-svn-init-clone.sh                    | 16 +++----\n t/t9118-git-svn-funky-branch-names.sh            | 20 ++++-----\n t/t9120-git-svn-clone-with-percent-escapes.sh    | 14 +++---\n t/t9125-git-svn-multi-glob-branch-names.sh       |  6 +--\n t/t9128-git-svn-cmd-branch.sh                    | 18 ++++----\n t/t9135-git-svn-moved-branch-empty-file.sh       |  2 +-\n t/t9141-git-svn-multiple-branches.sh             | 28 ++++++------\n t/t9145-git-svn-master-branch.sh                 |  2 +-\n t/t9155-git-svn-fetch-deleted-tag.sh             |  4 +-\n t/t9156-git-svn-fetch-deleted-tag-2.sh           |  6 +--\n t/t9161-git-svn-mergeinfo-push.sh                | 22 +++++-----\n t/t9163-git-svn-reset-clears-caches.sh           |  4 +-\n t/t9165-git-svn-fetch-merge-branch-of-branch.sh  |  2 +-\n t/t9166-git-svn-fetch-merge-branch-of-branch2.sh |  2 +-\n t/t9167-git-svn-cmd-branch-subproject.sh         |  2 +-\n 20 files changed, 131 insertions(+), 153 deletions(-)\n"}]}