git svn clone:分支从repo/移到repo/branches/,“格式错误的XML:找不到元素" [英] git svn clone: branches moved from repo/ to repo/branches/ and "Malformed XML: no element found"
问题描述
在Cygwin下使用git 2.8.2和svn 1.9.4,用git svn clone
克隆我们的存储库时,我在某个提交时碰到了一堵砖墙:
r3640 = eb94... (refs/remotes/svn/trunk)
Found possible branch point: https://.../repo/<branchname> => https://.../repo/branches/<branchname>, 3641
Initializing parent: refs/remotes/svn/<branchname>@3641
Error from SVN, (175009): Malformed network data: The XML response contains invalid XML: Malformed XML: no element found
观察#1:使用-r3600:HEAD
克隆时,即从最近一次的提交开始,操作成功.繁琐的实验表明,当在有问题的提交之前从大约100个修订版本开始克隆时,就会出现该问题.
观察#2:这似乎只发生在上述形式的分支上:错误地在回购根目录repo/<branchname>
中创建,然后移至repo/branches/<branchname>
有什么问题以及如何解决?
解决方案:扩大您的--log-window-size
值(默认值:100).
注意事项:较大的窗口大小禁止获取许多新添加文件的提交:
- 一次提交3961个新文件后,窗口大小7000反复失败
- 一次提交4927个新文件后,窗口大小4000失败
受影响的提交中实际上有8430个新文件.
这全在Cygwin之下,我无法在Linux上重现这些问题,因此您的工作量可能会有所不同.
我注意到观察到的导致错误的修订距离与git svn fetch --log-window-size
选项的默认值相似:均为100.
使用4000的日志窗口解决了我的问题, 解决方案
Solution: enlarge your --log-window-size
value (default: 100).
Caveat: larger window sizes inhibited the fetching of commits with many newly added files:
- window size of 7000 failed repeatedly after 3961 new files in a commit
- window size of 4000 failed after 4927 new files in a commit
There were actually 8430 new files in the affected commit.
This is all under Cygwin and I couldn't reproduce these problems on Linux, so your mileage may vary.
I noticed a similarity between the observed revision distance that causes the error and the default value of the git svn fetch --log-window-size
option: both are 100.
Using a log window of 4000 solved the problem in my case, others have used even larger values for speeding up the initial clone/fetch operation.
I have verified the issue by cloning from 10 revisions before the problematic revision and using --log-window-size=1
-- it failed again.
It would be interesting to know whether this is intended behavior or a bug on git-svn's side, as --log-window-size
is documented to speed up the clone/fetching operation, and not as a necessity for fixing some branching issues.
这篇关于git svn clone:分支从repo/移到repo/branches/,“格式错误的XML:找不到元素"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!