开发者

Git svn clone with bizarre directory hierarchy

We have an SVN repository that has the following structure:

https://xxxxxx.com/svn/foo/project/trunk/app/STUFF_I_WANT
https://xxxxxx.com/svn/foo/project/branches/dev/BRANCH_NAME/bar/STUFF_I_WANT

STUFF_I_WA开发者_开发技巧NT is, naturally, the stuff I want. The STUFF_I_WANT in the trunk follows the same hierarchy as the STUFF_I_WANT in the branches. BRANCH_NAME is variable. The "bar" directory is always there in any branch--in other words rather than "app" like in the trunk, the parent folder of the project in the branch is called "bar". In addition, there may be a number of other unrelated subdirectories inside "bar".

I can check out the trunk, and individual branches just fine. However, I'm totally stumped on checking out the trunk while still allowing it to track the branches. I've tried a number of different commands, but they all end up giving me a repo with just zero or one commits inside. The main error that keeps getting printed to the console is "Couldn't find revmap".

I've tried all of the following variations on git svn init/clone, to no avail--they all yield the same results I mentioned above.

git svn clone -$(svn log -q --limit 1 $SVN_URL | awk '/^r/{print $1}') $SVN_URL -T trunk/app -b branches/dev/*/bar

git svn clone -$(svn log -q --limit 1 $SVN_URL | awk '/^r/{print $1}') $SVN_URL -T trunk/app -b branches/dev

git svn init $SVN_URL -T trunk/app -b branches/dev

That last one, I followed up by editing .git/config to have branches = ipssdt/branches/dev//ccix:refs/remotes/ but it didn't work either.


Try

git svn init $SVN_URL -T trunk/app -b 'branches/dev/*/bar'

I am not sure it will do the right thing, so then go to the .git/config and check the options. I believe they should be:

fetch = trunk/app:refs/remotes/trunk
branches = branches/dev/*/bar:refs/remotes/branches/*

The documentation explicitly says that * is supported anywhere inside the subversion branch path, not just at the end, but you still have to specify exact path to the branch—git svn can't guess that the branch is actually in a subdirectory of what you specified.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜