{"thread":{"id":"10606","subject":"git-svn questions: how to clone/init non-standard layout branches/tags?","startedAt":"2007-11-03T08:19:13Z","lastAt":"2007-11-07T22:56:20Z","messageCount":9,"participants":["Luke Lu","Benoit SIGOURE","Lars Hjemli"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"58081","messageId":"756D5EE2-FB2C-48DB-8242-14E154E34A9C@vicaya.com","threadId":"10606","inReplyTo":null,"subject":"git-svn questions: how to clone/init non-standard layout branches/tags?","fromName":"Luke Lu","fromEmail":"git@vicaya.com","sentAt":"2007-11-03T08:19:13Z","receivedAt":"2007-11-03T08:19:13Z","isPatch":false,"sender":{"key":"git@vicaya.com","avatar":null},"body":"There are a few svn repositories that use non-standard layout like this:\n\n<path_to_project>/trunk\n<path_to_project>/production\n<path_to_project>/some_branch\n\nproduction and some_branch are indeed branched from trunk.\n\n1. How do you init/clone svn repositories like that?\n2. Is there a way to add a new svn branch like that (say production  \nor some_branch) to an existing git-svn repository that has trunk cloned?\n\nThanks!\n\n__Luke\n"},{"id":"58094","messageId":"87597D7C-60FB-4CD8-BB27-7E870001A899@lrde.epita.fr","threadId":"10606","inReplyTo":"756D5EE2-FB2C-48DB-8242-14E154E34A9C@vicaya.com","subject":"Re: git-svn questions: how to clone/init non-standard layout branches/tags?","fromName":"Benoit SIGOURE","fromEmail":"tsuna@lrde.epita.fr","sentAt":"2007-11-03T10:56:35Z","receivedAt":"2007-11-03T10:56:35Z","isPatch":false,"sender":{"key":"tsunanet@gmail.com","avatar":"https://avatars.githubusercontent.com/u/128281?v=4"},"body":"On Nov 3, 2007, at 9:19 AM, Luke Lu wrote:\n\n> There are a few svn repositories that use non-standard layout like  \n> this:\n>\n> <path_to_project>/trunk\n> <path_to_project>/production\n> <path_to_project>/some_branch\n>\n> production and some_branch are indeed branched from trunk.\n>\n> 1. How do you init/clone svn repositories like that?\n\nI seem to remember that you can pass more than one `-b' option to git- \nsvn clone, so I'd basically do (untested):\ngit svn clone <url> -T trunk -b production -b some_branch\n\n> 2. Is there a way to add a new svn branch like that (say production  \n> or some_branch) to an existing git-svn repository that has trunk  \n> cloned?\n\nI don't know, but that'd be great indeed.\n\n-- \nBenoit Sigoure aka Tsuna\nEPITA Research and Development Laboratory\n\n\n"},{"id":"58136","messageId":"8c5c35580711030659x203f8ae8s40366c493a3eeae6@mail.gmail.com","threadId":"10606","inReplyTo":"87597D7C-60FB-4CD8-BB27-7E870001A899@lrde.epita.fr","subject":"Re: git-svn questions: how to clone/init non-standard layout branches/tags?","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2007-11-03T13:59:45Z","receivedAt":"2007-11-03T13:59:45Z","isPatch":false,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"On Nov 3, 2007 11:56 AM, Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:\n> On Nov 3, 2007, at 9:19 AM, Luke Lu wrote:\n> > 2. Is there a way to add a new svn branch like that (say production\n> > or some_branch) to an existing git-svn repository that has trunk\n> > cloned?\n>\n> I don't know, but that'd be great indeed.\n>\n\nYou can simply add \"fetch\" lines to  the relevant \"svn-remote\" section\nin .git/config.\n\n-- \nlarsh\n"},{"id":"58171","messageId":"C81F0AB6-ED04-405F-AA29-CD72816FB7B9@vicaya.com","threadId":"10606","inReplyTo":"8c5c35580711030659x203f8ae8s40366c493a3eeae6@mail.gmail.com","subject":"Re: git-svn questions: how to clone/init non-standard layout branches/tags?","fromName":"Luke Lu","fromEmail":"git@vicaya.com","sentAt":"2007-11-03T20:01:28Z","receivedAt":"2007-11-03T20:01:28Z","isPatch":false,"sender":{"key":"git@vicaya.com","avatar":null},"body":"\nOn Nov 3, 2007, at 6:59 AM, Lars Hjemli wrote:\n\n> On Nov 3, 2007 11:56 AM, Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:\n>> On Nov 3, 2007, at 9:19 AM, Luke Lu wrote:\n>>> 2. Is there a way to add a new svn branch like that (say production\n>>> or some_branch) to an existing git-svn repository that has trunk\n>>> cloned?\n>>\n>> I don't know, but that'd be great indeed.\n>>\n>\n> You can simply add \"fetch\" lines to  the relevant \"svn-remote\" section\n> in .git/config.\n\nI did try to add a \"fetch\" line for the production branch like this:\n\n[svn-remote \"svn\"]\n         url = svn+ssh://host/svn/project\n         fetch = production:refs/remotes/svn-prod\n         fetch = trunk:refs/remotes/git-svn\n\nwhich is modeled after http://lists-archives.org/git/420712-git-svn- \nremote-tracking-branch-question.html\n\nBut when I try to checkout the production branch like this:\n\ngit checkout -b prod remotes/svn-prod\n\nI got this:\ngit checkout: updating paths is incompatible with switching branches/ \nforcing\nDid you intend to checkout 'remotes/svn-prod' which can not be  \nresolved as commit?\n\nCan you shed some light on this? (git version is 1.5.3.4)\n\nThanks!\n\n__Luke\n"},{"id":"58173","messageId":"8c5c35580711031332y4018dba6y5d24965ebf2fbefb@mail.gmail.com","threadId":"10606","inReplyTo":"C81F0AB6-ED04-405F-AA29-CD72816FB7B9@vicaya.com","subject":"Re: git-svn questions: how to clone/init non-standard layout branches/tags?","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2007-11-03T20:32:02Z","receivedAt":"2007-11-03T20:32:02Z","isPatch":false,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"On Nov 3, 2007 9:01 PM, Luke Lu <git@vicaya.com> wrote:\n> On Nov 3, 2007, at 6:59 AM, Lars Hjemli wrote:\n> > On Nov 3, 2007 11:56 AM, Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:\n> >> On Nov 3, 2007, at 9:19 AM, Luke Lu wrote:\n> >>> 2. Is there a way to add a new svn branch like that (say production\n> >>> or some_branch) to an existing git-svn repository that has trunk\n> >>> cloned?\n> >>\n> >> I don't know, but that'd be great indeed.\n> >>\n> >\n> > You can simply add \"fetch\" lines to  the relevant \"svn-remote\" section\n> > in .git/config.\n>\n> I did try to add a \"fetch\" line for the production branch like this:\n>\n> [svn-remote \"svn\"]\n>          url = svn+ssh://host/svn/project\n>          fetch = production:refs/remotes/svn-prod\n>          fetch = trunk:refs/remotes/git-svn\n>\n> which is modeled after http://lists-archives.org/git/420712-git-svn-\n> remote-tracking-branch-question.html\n>\n> But when I try to checkout the production branch like this:\n>\n> git checkout -b prod remotes/svn-prod\n>\n> I got this:\n> git checkout: updating paths is incompatible with switching branches/\n> forcing\n> Did you intend to checkout 'remotes/svn-prod' which can not be\n> resolved as commit?\n\nDid you forget to run 'git svn fetch' after modifying your .git/config?\n\n--\nlarsh\n"},{"id":"58174","messageId":"8644CD78-25F0-42C4-A163-BD88528594F3@vicaya.com","threadId":"10606","inReplyTo":"8c5c35580711031332y4018dba6y5d24965ebf2fbefb@mail.gmail.com","subject":"Re: git-svn questions: how to clone/init non-standard layout branches/tags?","fromName":"Luke Lu","fromEmail":"git@vicaya.com","sentAt":"2007-11-03T20:41:55Z","receivedAt":"2007-11-03T20:41:55Z","isPatch":false,"sender":{"key":"git@vicaya.com","avatar":null},"body":"\nOn Nov 3, 2007, at 1:32 PM, Lars Hjemli wrote:\n\n> On Nov 3, 2007 9:01 PM, Luke Lu <git@vicaya.com> wrote:\n>> On Nov 3, 2007, at 6:59 AM, Lars Hjemli wrote:\n>>> On Nov 3, 2007 11:56 AM, Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:\n>>>> On Nov 3, 2007, at 9:19 AM, Luke Lu wrote:\n>>>>> 2. Is there a way to add a new svn branch like that (say  \n>>>>> production\n>>>>> or some_branch) to an existing git-svn repository that has trunk\n>>>>> cloned?\n>>>>\n>>>> I don't know, but that'd be great indeed.\n>>>>\n>>>\n>>> You can simply add \"fetch\" lines to  the relevant \"svn-remote\"  \n>>> section\n>>> in .git/config.\n>>\n>> I did try to add a \"fetch\" line for the production branch like this:\n>>\n>> [svn-remote \"svn\"]\n>>          url = svn+ssh://host/svn/project\n>>          fetch = production:refs/remotes/svn-prod\n>>          fetch = trunk:refs/remotes/git-svn\n>>\n>> which is modeled after http://lists-archives.org/git/420712-git-svn-\n>> remote-tracking-branch-question.html\n>>\n>> But when I try to checkout the production branch like this:\n>>\n>> git checkout -b prod remotes/svn-prod\n>>\n>> I got this:\n>> git checkout: updating paths is incompatible with switching branches/\n>> forcing\n>> Did you intend to checkout 'remotes/svn-prod' which can not be\n>> resolved as commit?\n>\n> Did you forget to run 'git svn fetch' after modifying your .git/ \n> config?\n\nYes, I did. It didn't seem to do anything. $? is 0. the master/trunk  \nis up-to-date but the production branch has never been fetched. If  \nthis is supposed to work, the fetch might be triggered upon next  \nupdate in trunk?\n\n__Luke\n"},{"id":"58177","messageId":"8c5c35580711031352n3396807fm3004ebe8f86110ed@mail.gmail.com","threadId":"10606","inReplyTo":"8644CD78-25F0-42C4-A163-BD88528594F3@vicaya.com","subject":"Re: git-svn questions: how to clone/init non-standard layout branches/tags?","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2007-11-03T20:52:46Z","receivedAt":"2007-11-03T20:52:46Z","isPatch":false,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"On Nov 3, 2007 9:41 PM, Luke Lu <git@vicaya.com> wrote:\n> On Nov 3, 2007, at 1:32 PM, Lars Hjemli wrote:\n> > On Nov 3, 2007 9:01 PM, Luke Lu <git@vicaya.com> wrote:\n> >> I did try to add a \"fetch\" line for the production branch like this:\n> >>\n> >> [svn-remote \"svn\"]\n> >>          url = svn+ssh://host/svn/project\n> >>          fetch = production:refs/remotes/svn-prod\n> >>          fetch = trunk:refs/remotes/git-svn\n> >>\n> >> which is modeled after http://lists-archives.org/git/420712-git-svn-\n> >> remote-tracking-branch-question.html\n> >>\n> > Did you forget to run 'git svn fetch' after modifying your .git/\n> > config?\n>\n> Yes, I did. It didn't seem to do anything.\n\nHmm, it works for me, I've been adding and removing branches like this\nfor months, but my .git/config is slightly different:\n\n[svn-remote \"svn\"]\n        url = svn://example.org\n        fetch = project/trunk:refs/remotes/svn/trunk\n        fetch = project/branches/topic:refs/remotes/svn/topic\n\nI don't know if this difference is important, though...\n\n-- \nlarsh\n"},{"id":"58179","messageId":"B0D0BB75-58AF-4E4E-8C3F-6E615870016A@vicaya.com","threadId":"10606","inReplyTo":"8c5c35580711031352n3396807fm3004ebe8f86110ed@mail.gmail.com","subject":"Re: git-svn questions: how to clone/init non-standard layout branches/tags?","fromName":"Luke Lu","fromEmail":"git@vicaya.com","sentAt":"2007-11-03T21:26:49Z","receivedAt":"2007-11-03T21:26:49Z","isPatch":false,"sender":{"key":"git@vicaya.com","avatar":null},"body":"\nOn Nov 3, 2007, at 1:52 PM, Lars Hjemli wrote:\n\n> On Nov 3, 2007 9:41 PM, Luke Lu <git@vicaya.com> wrote:\n>> On Nov 3, 2007, at 1:32 PM, Lars Hjemli wrote:\n>>> On Nov 3, 2007 9:01 PM, Luke Lu <git@vicaya.com> wrote:\n>>>> I did try to add a \"fetch\" line for the production branch like  \n>>>> this:\n>>>>\n>>>> [svn-remote \"svn\"]\n>>>>          url = svn+ssh://host/svn/project\n>>>>          fetch = production:refs/remotes/svn-prod\n>>>>          fetch = trunk:refs/remotes/git-svn\n>>>>\n>>>> which is modeled after http://lists-archives.org/git/420712-git- \n>>>> svn-\n>>>> remote-tracking-branch-question.html\n>>>>\n>>> Did you forget to run 'git svn fetch' after modifying your .git/\n>>> config?\n>>\n>> Yes, I did. It didn't seem to do anything.\n>\n> Hmm, it works for me, I've been adding and removing branches like this\n> for months, but my .git/config is slightly different:\n>\n> [svn-remote \"svn\"]\n>         url = svn://example.org\n>         fetch = project/trunk:refs/remotes/svn/trunk\n>         fetch = project/branches/topic:refs/remotes/svn/topic\n>\n> I don't know if this difference is important, though...\n\nI tried to test this on a local repository like file:///path/project.  \nIt seems to work and get everything properly upon git svn fetch.  \nHowever it doesn't work for the production branch. If I modify the  \nfetch line a bit to svn/prod instead of svn-prod and try git svn  \nfetch again. It would hang for about 2 minutes and return 0 and show  \nnothing in progress. A .git/svn/svn/prod directory is created but  \nit's empty.\n\nOne thing that might be special for this branch is that it gets  \ndeleted and recreated/copied all the time from trunk. I wonder if git- \nsvn use some kind of heuristics to determine if there is anything to  \nfetch and silently failing...\n\n__Luke\n"},{"id":"58749","messageId":"D7E592C6-964E-467C-828F-81BA35275F42@vicaya.com","threadId":"10606","inReplyTo":"B0D0BB75-58AF-4E4E-8C3F-6E615870016A@vicaya.com","subject":"Re: git-svn questions: how to clone/init non-standard layout branches/tags?","fromName":"Luke Lu","fromEmail":"git@vicaya.com","sentAt":"2007-11-07T22:56:20Z","receivedAt":"2007-11-07T22:56:20Z","isPatch":false,"sender":{"key":"git@vicaya.com","avatar":null},"body":"In case others encounter this problem and want to find a solution...\n\nOn Nov 3, 2007, at 2:26 PM, Luke Lu wrote:\n> On Nov 3, 2007, at 1:52 PM, Lars Hjemli wrote:\n>> On Nov 3, 2007 9:41 PM, Luke Lu <git@vicaya.com> wrote:\n>>> On Nov 3, 2007, at 1:32 PM, Lars Hjemli wrote:\n>>>> On Nov 3, 2007 9:01 PM, Luke Lu <git@vicaya.com> wrote:\n>>>>> I did try to add a \"fetch\" line for the production branch like  \n>>>>> this:\n>>>>>\n>>>>> [svn-remote \"svn\"]\n>>>>>          url = svn+ssh://host/svn/project\n>>>>>          fetch = production:refs/remotes/svn-prod\n>>>>>          fetch = trunk:refs/remotes/git-svn\n>>>>>\n>>>>> which is modeled after http://lists-archives.org/git/420712-git- \n>>>>> svn-\n>>>>> remote-tracking-branch-question.html\n>>>>>\n>>>> Did you forget to run 'git svn fetch' after modifying your .git/\n>>>> config?\n>>>\n>>> Yes, I did. It didn't seem to do anything.\n>>\n>> Hmm, it works for me, I've been adding and removing branches like  \n>> this\n>> for months, but my .git/config is slightly different:\n>>\n>> [svn-remote \"svn\"]\n>>         url = svn://example.org\n>>         fetch = project/trunk:refs/remotes/svn/trunk\n>>         fetch = project/branches/topic:refs/remotes/svn/topic\n>>\n>> I don't know if this difference is important, though...\n>\n> I tried to test this on a local repository like file:///path/ \n> project. It seems to work and get everything properly upon git svn  \n> fetch. However it doesn't work for the production branch. If I  \n> modify the fetch line a bit to svn/prod instead of svn-prod and try  \n> git svn fetch again. It would hang for about 2 minutes and return 0  \n> and show nothing in progress. A .git/svn/svn/prod directory is  \n> created but it's empty.\n>\n> One thing that might be special for this branch is that it gets  \n> deleted and recreated/copied all the time from trunk. I wonder if  \n> git-svn use some kind of heuristics to determine if there is  \n> anything to fetch and silently failing...\n\nAfter some permutations, this is the config that worked for me:\n\n[svn-remote \"svn\"]\n\turl = svn+ssh://host/svn\n\tfetch = project/trunk:refs/remotes/git-svn\n\tfetch = project/production:refs/remotes/svn/production\n\nThe primary difference is that I moved 'project' from url to the  \nfetch specs. My original single trunk config looked like this:\n\n[svn-remote \"svn\"]\n\turl = svn+ssh://host/svn/project/trunk\n\tfetch = :refs/remotes/git-svn\n\nI wish that \"git svn fetch\" could be more verbose about what's going  \non in this case.\n\n__Luke\n"}]}