git svncherry pick 忽略警告
当我运行 git svn fetch 时,它有时会打印以下警告:
W:svn cherry-pick ignored (/path/in/svn:<svn revision number list>) missing 55 commit(s) (eg 9129b28e5397c41f0a527818edd344bf264359af)
此警告是关于什么的?
When I run git svn fetch
it sometimes prints following warning:
W:svn cherry-pick ignored (/path/in/svn:<svn revision number list>) missing 55 commit(s) (eg 9129b28e5397c41f0a527818edd344bf264359af)
What this warning is about?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当有人使用 Subversion 进行“择优合并”时,Subversion 会记录合并到所涉及文件和文件夹的元数据中的提交。
当您执行 git svn fetch 时,Git 会看到合并元数据,并尝试将其解释为 Git 远程分支之间的合并。所有这些消息都意味着 Git 尝试这样做,但失败了,因此它会将其记录为常规提交而不是合并。
这不是您需要担心的事情,除非您发现 Git 获取 Subversion 提交的方式存在错误。
更详细地说:
假设您有一个包含两个分支
A
和B
的 Subversion 存储库,以及一个匹配的 Git svn 存储库:如果您要重新集成分支
B
code> 回到分支A
,您可以在分支A
工作副本中使用命令,例如svn merge -r 3:HEAD ^/branches/B< /code> 或者只是
svn merge --reintegrate ^/branches/B
。 Subversion 会将元数据记录在svn:mergeinfo
标记中,记录此合并已发生,并且您的下一个git svn fetch
将看到此元数据,请参阅该分支B< /code> 已重新整合到分支
A
中,并将相应的提交记录在其历史记录中作为合并。如果您只想从分支
A
中的分支B
进行一次提交(假设 r3 添加了您需要的功能),但您不想重新集成整个分支,您可以使用 Subversion 命令,例如 svn merge -c 3 ^/branches/B。同样,Subversion 会记录合并元数据,Git 会看到这一点并尝试确定它是否可以像前面的示例一样记录分支合并。在这种情况下它不能:分支A
不包含分支B
的 r5 之类的内容。这就是触发此警告的原因。When someone does a "cherry-pick merge" with Subversion, Subversion records the commit that was merged in the metadata for the files and folders involved.
When you do a
git svn fetch
, Git sees that merge metadata, and tries to interpret it as a merge between the Git remote branches. All this message means is that Git tried to do that, but failed, so it'll record it as a regular commit rather than a merge.It's not something you need to worry about unless you're seeing bugs in how Git picks up Subversion commits.
In more detail:
Say you have a Subversion repository with two branches
A
andB
, with a matching Git svn repository:If you were to reintegrate branch
B
back into branchA
, you'd use a command in a branchA
working copy likesvn merge -r 3:HEAD ^/branches/B
or justsvn merge --reintegrate ^/branches/B
. Subversion would record metadata insvn:mergeinfo
tags recording that this merge had taken place, and your nextgit svn fetch
will see this metadata, see that branchB
has been reintegrated into branchA
, and record the corresponding commit in its history as a merge too.If you just wanted a single commit from branch
B
in branchA
(say r3 added a feature you need), but you don't want to reintegrate the entire branch yet, you'd instead use a Subversion command likesvn merge -c 3 ^/branches/B
. Again, Subversion would record merge metadata, and Git would see this and try to work out if it could record a branch merge as in the previous example. In this case it can't: branchA
doesn't contain anything like branchB
's r5. That's what triggers this warning.