I\'m struggling for a number of hours now with the --ignore-paths option to git-svn, in an attempt to fetch only certain tags from a large repository.
I want to start
I was having this same problem today: my regexp would just never match... Make sure you know what the target paths actually look like. I was making an incorrect assumption about the structure of the paths that were being fed to my regexp.
To find out what the paths look like, make git-svn output each path to the console as it tests them:
NOTE: Just in case, make a backup copy of the git-svn file first!
/libexec/git-core/git-svn
.is_path_ignored
subroutine.print
statement above the first return
statement, as follows...sub is_path_ignored {
my ($self, $path) = @_;
print STDERR "$path\n"; //<-- **ADD THIS LINE**
return 1 if in_dot_git($path);
return 1 if defined($self->{ignore_regex}) &&
$path =~ m!$self->{ignore_regex}!;
return 0 unless defined($_ignore_regex);
return 1 if $path =~ m!$_ignore_regex!o;
return 0;
}
Now use git-svn
again with the --ignore-paths
switch.
I realised that instead of paths like trunk/baz
it was actually using bar/trunk/baz
So instead of
--ignore-paths='^(?:trunk|branches|tags)/baz'
I needed to use
--ignore-paths='^bar/(?:trunk|branches|tags)/baz'
Don't forget to remove the print
statement from the git-svn script.