{"thread":{"id":"31669","subject":"Stopping git-svn pulling a particular branch","startedAt":"2012-09-28T04:58:37Z","lastAt":"2012-09-28T11:03:26Z","messageCount":2,"participants":["Jon Seymour"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"200067","messageId":"CAH3Anro6EOq0Qh6R6-YXpMW+9h0xtZcBR3KY0kRgWT-4mGf1xg@mail.gmail.com","threadId":"31669","inReplyTo":null,"subject":"Stopping git-svn pulling a particular branch","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-09-28T04:58:37Z","receivedAt":"2012-09-28T04:58:37Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"G'day\n\nAn svn developer created a branch from a subdirectory of the trunk\nrather than by copying trunk itself.\n\nI want to avoid pulling this branch into my git repo with git svn\nfetch because the re-rooting pulls in too much history and content\nthat I don't want.\n\nIs there any easy way to achieve this? I tried used the --ignore-paths\noption, but this doesn't seem suited to the purpose.\n\nI can delete the SVN branch if that will help, but past experience\nsuggests that it won't.\n\njon.\n"},{"id":"200083","messageId":"CAH3AnroU4gpf38qTAz87=jbcXCg3Zq_bDk=3BozGgyOGz5HREg@mail.gmail.com","threadId":"31669","inReplyTo":"CAH3Anro6EOq0Qh6R6-YXpMW+9h0xtZcBR3KY0kRgWT-4mGf1xg@mail.gmail.com","subject":"Re: Stopping git-svn pulling a particular branch","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-09-28T11:03:26Z","receivedAt":"2012-09-28T11:03:26Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Fri, Sep 28, 2012 at 2:58 PM, Jon Seymour <jon.seymour@gmail.com> wrote:\n> G'day\n>\n> An svn developer created a branch from a subdirectory of the trunk\n> rather than by copying trunk itself.\n>\n> I want to avoid pulling this branch into my git repo with git svn\n> fetch because the re-rooting pulls in too much history and content\n> that I don't want.\n>\n> Is there any easy way to achieve this? I tried used the --ignore-paths\n> option, but this doesn't seem suited to the purpose.\n>\n> I can delete the SVN branch if that will help, but past experience\n> suggests that it won't.\n>\n\nAnswering my own question. There is an undocumented option to git-svn\n--ignore-refs which can be used to achieve this.\n\nI found that I had to manually delete the directories corresponding to\nthe bogus branches from .git/svn/refs/remotes, then re-run git svn\nfetch with the --ignore-refs option set to a regex that matched the\nbogus branches.\n\nThis allowed me to fetch everything else I needed to fetch and\nadvanced the maxRevs metadata in .git/svn/.metadata past the\nproblematic  branches so that subsequent svn fetch calls avoided the\nattempts to fetch the bogus branches.\n\nI'll draft a documentation patch when I get a chance...\n\njon.\n"}]}