threads / discuss / 31669

Stopping git-svn pulling a particular branch

Subject: Stopping git-svn pulling a particular branch

## tl;dr

2 messages between Sep 28, 2012 and Sep 28, 2012.

replies: 1people: 1as markdown or json

Jon Seymour· Sep 28, 2012, 04:58 UTC · lore
G'day

An svn developer created a branch from a subdirectory of the trunk rather than by copying trunk itself.

I want to avoid pulling this branch into my git repo with git svn fetch because the re-rooting pulls in too much history and content that I don't want.

Is there any easy way to achieve this? I tried used the --ignore-paths option, but this doesn't seem suited to the purpose.

I can delete the SVN branch if that will help, but past experience suggests that it won't.

jon.
Jon Seymour· Sep 28, 2012, 11:03 UTC · re: Jon Seymour · lore

Re: Stopping git-svn pulling a particular branch

On Fri, Sep 28, 2012 at 2:58 PM, Jon Seymour <jon.seymour@gmail.com> wrote:
Show 15 quoted lines
> G'day
>
> An svn developer created a branch from a subdirectory of the trunk
> rather than by copying trunk itself.
>
> I want to avoid pulling this branch into my git repo with git svn
> fetch because the re-rooting pulls in too much history and content
> that I don't want.
>
> Is there any easy way to achieve this? I tried used the --ignore-paths
> option, but this doesn't seem suited to the purpose.
>
> I can delete the SVN branch if that will help, but past experience
> suggests that it won't.
>

Answering my own question. There is an undocumented option to git-svn --ignore-refs which can be used to achieve this.

I found that I had to manually delete the directories corresponding to the bogus branches from .git/svn/refs/remotes, then re-run git svn fetch with the --ignore-refs option set to a regex that matched the bogus branches.

This allowed me to fetch everything else I needed to fetch and advanced the maxRevs metadata in .git/svn/.metadata past the problematic branches so that subsequent svn fetch calls avoided the attempts to fetch the bogus branches.

I'll draft a documentation patch when I get a chance...
jon.

← back to recent threads