{"thread":{"id":"20133","subject":"how to fetch a new svn branch after clone?","startedAt":"2009-07-16T15:30:27Z","lastAt":"2009-07-17T16:09:24Z","messageCount":5,"participants":["Changsheng Jiang","Marc Branchaud"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"118115","messageId":"eafc0afe0907160830m29e2f3d3jf5c0e9db29cace54@mail.gmail.com","threadId":"20133","inReplyTo":null,"subject":"how to fetch a new svn branch after clone?","fromName":"Changsheng Jiang","fromEmail":"jiangzuoyan@gmail.com","sentAt":"2009-07-16T15:30:27Z","receivedAt":"2009-07-16T15:30:27Z","isPatch":false,"sender":{"key":"jiangzuoyan@gmail.com","avatar":"https://gravatar.com/avatar/61eb7704963065c5937698bacbc1412b6083e1d43f2cc9642999fe10b2e582f8?d=mp&s=160"},"body":"Hi list,\n\nI know how to clone a svn repository with all branches and tags at the\ninitial step, but I find no answers of how to fetch a new svn branch\nafter clone.\n\nFor example, this\n\ngit svn clone http://svn.example.com/project -T trunk -b branches -t tags\n\nwill clone all branches. but that clone, the svn repository has a new\nbranch test with url http://svn.example.com/project/test, how to clone\nit as the initial step?\n\nThanks.\n\n                                                     Changsheng Jiang\n"},{"id":"118130","messageId":"4A5F8CDA.5080202@xiplink.com","threadId":"20133","inReplyTo":"eafc0afe0907160830m29e2f3d3jf5c0e9db29cace54@mail.gmail.com","subject":"Re: how to fetch a new svn branch after clone?","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2009-07-16T20:26:02Z","receivedAt":"2009-07-16T20:26:02Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"The latest 1.6.4-rc1 contains patches to git-svn for it to support more than one branch URL in an svn repository.\n\nHowever, before I describe that, can you confirm whether your new branch is in fact named\n\n\thttp://svn.example.com/project/test\n\nor is it really\n\n\thttp://svn.example.com/project/test/<branchname>\n\nBecause if it's the former then I'm not sure if git-svn can handle your new branch.  The problem is that even though the branch is named 'test' it's a sibling to the 'branches' 'tags' and 'trunk' paths in the repository.  For git-svn to pick up branches, you point it at the path *containing* the branch names.  In the former case, to pick up project/test as the 'test' branch you'd have to point git-svn at the project directory, and that would cause it to also pick up project/tags, project/branches, and project/trunk as other branches (named 'tags', 'branches' and 'trunk').\n\nHowever, in the latter (test/<branchname>) case, with 1.6.4, I *think* git-svn will pick up the new branches under test if you add a new 'branches' line to the svn-remote's section in your .git/config file.  Something like\n\n\tbranches = test/*:refs/remotes/*\n\nmight let you see the new branches.  The reason I can't be more certain is that if you've done a 'git svn fetch' since the branch was created then git-svn might not pick up the branch-creation commits later.  Unfortunately I don't know git-svn well enough to say for certain.\n\n\t\tM.\n\n\nChangsheng Jiang wrote:\n> Hi list,\n> \n> I know how to clone a svn repository with all branches and tags at the\n> initial step, but I find no answers of how to fetch a new svn branch\n> after clone.\n> \n> For example, this\n> \n> git svn clone http://svn.example.com/project -T trunk -b branches -t tags\n> \n> will clone all branches. but that clone, the svn repository has a new\n> branch test with url http://svn.example.com/project/test, how to clone\n> it as the initial step?\n> \n> Thanks.\n> \n>                                                      Changsheng Jiang\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"118150","messageId":"eafc0afe0907161900k35b2dff1u5a2bfc574bb93231@mail.gmail.com","threadId":"20133","inReplyTo":"4A5F8CDA.5080202@xiplink.com","subject":"Re: how to fetch a new svn branch after clone?","fromName":"Changsheng Jiang","fromEmail":"jiangzuoyan@gmail.com","sentAt":"2009-07-17T02:00:22Z","receivedAt":"2009-07-17T02:00:22Z","isPatch":false,"sender":{"key":"jiangzuoyan@gmail.com","avatar":"https://gravatar.com/avatar/61eb7704963065c5937698bacbc1412b6083e1d43f2cc9642999fe10b2e582f8?d=mp&s=160"},"body":"Thank Marc.\n\nYou are right, it should be the latter case with url\nhttp://www.example.com/project/branches/test\n\nBut \"git svn clone\" has already added these lines to .git/config\n\n[svn-remote \"svn\"]\n\turl = https://xxx.xxxx.com/svn/xxx\n\tfetch = trunk:refs/remotes/trunk\n\tbranches = branches/*:refs/remotes/*\n\ttags = tags/*:refs/remotes/tags/*\n\nAnd it still can not fetch new branch.\n\n                                                      Changsheng Jiang\n\nOn Fri, Jul 17, 2009 at 04:26, Marc Branchaud<marcnarc@xiplink.com> wrote:\n> The latest 1.6.4-rc1 contains patches to git-svn for it to support more than one branch URL in an svn repository.\n>\n> However, before I describe that, can you confirm whether your new branch is in fact named\n>\n>        http://svn.example.com/project/test\n>\n> or is it really\n>\n>        http://svn.example.com/project/test/<branchname>\n>\n> Because if it's the former then I'm not sure if git-svn can handle your new branch.  The problem is that even though the branch is named 'test' it's a sibling to the 'branches' 'tags' and 'trunk' paths in the repository.  For git-svn to pick up branches, you point it at the path *containing* the branch names.  In the former case, to pick up project/test as the 'test' branch you'd have to point git-svn at the project directory, and that would cause it to also pick up project/tags, project/branches, and project/trunk as other branches (named 'tags', 'branches' and 'trunk').\n>\n> However, in the latter (test/<branchname>) case, with 1.6.4, I *think* git-svn will pick up the new branches under test if you add a new 'branches' line to the svn-remote's section in your .git/config file.  Something like\n>\n>        branches = test/*:refs/remotes/*\n>\n> might let you see the new branches.  The reason I can't be more certain is that if you've done a 'git svn fetch' since the branch was created then git-svn might not pick up the branch-creation commits later.  Unfortunately I don't know git-svn well enough to say for certain.\n>\n>                M.\n>\n>\n> Changsheng Jiang wrote:\n>> Hi list,\n>>\n>> I know how to clone a svn repository with all branches and tags at the\n>> initial step, but I find no answers of how to fetch a new svn branch\n>> after clone.\n>>\n>> For example, this\n>>\n>> git svn clone http://svn.example.com/project -T trunk -b branches -t tags\n>>\n>> will clone all branches. but that clone, the svn repository has a new\n>> branch test with url http://svn.example.com/project/test, how to clone\n>> it as the initial step?\n>>\n>> Thanks.\n>>\n>>                                                      Changsheng Jiang\n>> --\n>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>> the body of a message to majordomo@vger.kernel.org\n>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"118152","messageId":"eafc0afe0907161925j331ad90cx708bd3f1663c4c71@mail.gmail.com","threadId":"20133","inReplyTo":"6786ed4f0907161918t5d4489a5uf1c315b07f850e2e@mail.gmail.com","subject":"Re: how to fetch a new svn branch after clone?","fromName":"Changsheng Jiang","fromEmail":"jiangzuoyan@gmail.com","sentAt":"2009-07-17T02:25:38Z","receivedAt":"2009-07-17T02:25:38Z","isPatch":false,"sender":{"key":"jiangzuoyan@gmail.com","avatar":"https://gravatar.com/avatar/61eb7704963065c5937698bacbc1412b6083e1d43f2cc9642999fe10b2e582f8?d=mp&s=160"},"body":"Thank Allen.\n\nI deleted some branches in local git repository, since it's no need to\ntrack every one's branch.\n\nAnd after that, ''git svn fetch'' report error like this:\n\nerror: invalid object a0eb1d6f18d20c0b9f30062cd981e9b668aac75f\nfatal: git-write-tree: error building trees\nwrite-tree: command returned error: 128\n\nIs it wrong to delete some svn branches in git by \"git branch -r -d branch_name\"\n\n                                                      Changsheng Jiang\n\n\n\nOn Fri, Jul 17, 2009 at 10:18, Allen Johnson<akjohnson78@gmail.com> wrote:\n> This setup works for me:\n>\n> # create branch directly in svn\n> svn copy svn://hostname/project/trunk\n> svn://hostname/project/branches/test -m \"test\"\n>\n> # update your local git repository\n> git svn fetch\n>\n> # verify you have the branch by listing all remote branches\n> git branch -r\n>\n> # you should see \"test\" in the list, now checkout that branch and do some work\n> git checkout -b local-test test\n>\n> # perform some commits on that branch then sync with svn\n> git commit ...\n> git svn rebase\n> git svn dcommit\n>\n> Hope that works for you.\n>\n> Allen\n>\n> On Thu, Jul 16, 2009 at 10:00 PM, Changsheng Jiang<jiangzuoyan@gmail.com> wrote:\n>> Thank Marc.\n>>\n>> You are right, it should be the latter case with url\n>> http://www.example.com/project/branches/test\n>>\n>> But \"git svn clone\" has already added these lines to .git/config\n>>\n>> [svn-remote \"svn\"]\n>>        url = https://xxx.xxxx.com/svn/xxx\n>>        fetch = trunk:refs/remotes/trunk\n>>        branches = branches/*:refs/remotes/*\n>>        tags = tags/*:refs/remotes/tags/*\n>>\n>> And it still can not fetch new branch.\n>>\n>>                                                      Changsheng Jiang\n>>\n>> On Fri, Jul 17, 2009 at 04:26, Marc Branchaud<marcnarc@xiplink.com> wrote:\n>>> The latest 1.6.4-rc1 contains patches to git-svn for it to support more than one branch URL in an svn repository.\n>>>\n>>> However, before I describe that, can you confirm whether your new branch is in fact named\n>>>\n>>>        http://svn.example.com/project/test\n>>>\n>>> or is it really\n>>>\n>>>        http://svn.example.com/project/test/<branchname>\n>>>\n>>> Because if it's the former then I'm not sure if git-svn can handle your new branch.  The problem is that even though the branch is named 'test' it's a sibling to the 'branches' 'tags' and 'trunk' paths in the repository.  For git-svn to pick up branches, you point it at the path *containing* the branch names.  In the former case, to pick up project/test as the 'test' branch you'd have to point git-svn at the project directory, and that would cause it to also pick up project/tags, project/branches, and project/trunk as other branches (named 'tags', 'branches' and 'trunk').\n>>>\n>>> However, in the latter (test/<branchname>) case, with 1.6.4, I *think* git-svn will pick up the new branches under test if you add a new 'branches' line to the svn-remote's section in your .git/config file.  Something like\n>>>\n>>>        branches = test/*:refs/remotes/*\n>>>\n>>> might let you see the new branches.  The reason I can't be more certain is that if you've done a 'git svn fetch' since the branch was created then git-svn might not pick up the branch-creation commits later.  Unfortunately I don't know git-svn well enough to say for certain.\n>>>\n>>>                M.\n>>>\n>>>\n>>> Changsheng Jiang wrote:\n>>>> Hi list,\n>>>>\n>>>> I know how to clone a svn repository with all branches and tags at the\n>>>> initial step, but I find no answers of how to fetch a new svn branch\n>>>> after clone.\n>>>>\n>>>> For example, this\n>>>>\n>>>> git svn clone http://svn.example.com/project -T trunk -b branches -t tags\n>>>>\n>>>> will clone all branches. but that clone, the svn repository has a new\n>>>> branch test with url http://svn.example.com/project/test, how to clone\n>>>> it as the initial step?\n>>>>\n>>>> Thanks.\n>>>>\n>>>>                                                      Changsheng Jiang\n>>>> --\n>>>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>>>> the body of a message to majordomo@vger.kernel.org\n>>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>>>\n>> --\n>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>> the body of a message to majordomo@vger.kernel.org\n>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>>\n>\n"},{"id":"118182","messageId":"4A60A234.5020907@xiplink.com","threadId":"20133","inReplyTo":"eafc0afe0907161900k35b2dff1u5a2bfc574bb93231@mail.gmail.com","subject":"Re: how to fetch a new svn branch after clone?","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2009-07-17T16:09:24Z","receivedAt":"2009-07-17T16:09:24Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"Changsheng Jiang wrote:\n> Thank Marc.\n> \n> You are right, it should be the latter case with url\n> http://www.example.com/project/branches/test\n\nHmmm, that isn't a case I mentioned in my previous email.  Are you saying that the layout is actually\n\n\thttp://www.example.com/project/branches/<some branches>\n\thttp://www.example.com/project/branches/test/<some other branches>\n\nIf that's the case I think you might be stuck.  I think git-svn can't handle that layout (with branch names under both branches/ and branches/test/).\n\n> But \"git svn clone\" has already added these lines to .git/config\n> \n> [svn-remote \"svn\"]\n> \turl = https://xxx.xxxx.com/svn/xxx\n> \tfetch = trunk:refs/remotes/trunk\n> \tbranches = branches/*:refs/remotes/*\n> \ttags = tags/*:refs/remotes/tags/*\n> \n> And it still can not fetch new branch.\n\nYes.  If you had a layout that git-svn supported, you would need to add a _second_ branches line.\n\n\t\tM.\n"}]}