I am using git in a shop that is all Subversion. When I check out a repo using
git svn clone -s --preserve-empty-dirs https://<subversion-server>/svn/<repo> <folder-name>
All seems well as the cloning process begins, but at some point during the process, git fails with
Failed to strip path '<path-to-some-file>' ((?^:^trunk(/|$)))
Anyone know what's wrong or how to fix this?
Searching the interwebs turned up both an explanation and advice on how to fix this (see step 4).
Note:
From v1.7.7 onward, Git has a
--preserve-empty-dirs
. Problem is, the damn thing's broken. If you try to use it as-is, the whole operation will likely just fail partway through. It has to be fixed.
But the advice may be dated, as it did not work for my installation (git 2.7.0). But now knowing the issue, I was able to find the offending line and apply the suggested fix:
The fix was made by changing the offending line in usr/lib/perl5/vendor_perl/5.22/Git/SVN/Fetcher.pm
, line 163:
Change die "Failed to strip path...
to print "Failed to strip path...
and all will be well.
I hope that helps someone else out there as well.