git svncherry pick 忽略警告

发布于 2025-01-08 08:57:46 字数 225 浏览 0 评论 0原文

当我运行 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心是晴朗的。 2025-01-15 08:57:46

当有人使用 Subversion 进行“择优合并”时,Subversion 会记录合并到所涉及文件和文件夹的元数据中的提交。

当您执行 git svn fetch 时,Git 会看到合并元数据,并尝试将其解释为 Git 远程分支之间的合并。所有这些消息都意味着 Git 尝试这样做,但失败了,因此它会将其记录为常规提交而不是合并。

这不是您需要担心的事情,除非您发现 Git 获取 Subversion 提交的方式存在错误。

更详细地说:

假设您有一个包含两个分支 AB 的 Subversion 存储库,以及一个匹配的 Git svn 存储库:

A B   

*    r6
| *  r5
* |  r4
| *  r3
|/     
*    r2
*    r1

如果您要重新集成分支 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 and B, with a matching Git svn repository:

A B   

*    r6
| *  r5
* |  r4
| *  r3
|/     
*    r2
*    r1

If you were to reintegrate branch B back into branch A, you'd use a command in a branch A working copy like svn merge -r 3:HEAD ^/branches/B or just svn merge --reintegrate ^/branches/B. Subversion would record metadata in svn:mergeinfo tags recording that this merge had taken place, and your next git svn fetch will see this metadata, see that branch B has been reintegrated into branch A, and record the corresponding commit in its history as a merge too.

If you just wanted a single commit from branch B in branch A (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 like svn 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: branch A doesn't contain anything like branch B's r5. That's what triggers this warning.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文