Git-SVN与svn.pushmergeinfo:如何避免自引用mergeinfo行 [英] Git-SVN with svn.pushmergeinfo: how to avoid self-referencing mergeinfo lines

查看:307
本文介绍了Git-SVN与svn.pushmergeinfo:如何避免自引用mergeinfo行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


p> config key:svn.pushmergeinfo



这个选项会导致git-svn在可能的情况下尝试自动填充SVN仓库中的svn:mergeinfo属性。目前,只有在提交非快进合并的情况下,只有第一个父母已经被推入SVN的情况下,才能完成这项工作。


我们正在使用这个混合环境,其中一些开发人员使用SVN,一些使用Git-SVN。在Git中分支和合并SVN分支,然后将 git svn dcommit -ing返回到SVN,这在工作上非常出色,并且在几乎所有情况下它实际上都正确地填充了mergeinfo属性。但是,在特定情况下,它做得不正确。

这主要发生在将分支合并到该分支(实际上相当于SVN重新集成)后将分支合并到主分支(主干)中。

从trunk到分支的合并为该分支上的trunk添加一条mergeinfo行(根据需要),但重新合并 - 从分支返回到trunk复制该行到trunk的mergeinfo中,有效地在trunk的mergeinfo属性中创建一个指向自身的自引用行。据我所知,这种自我引用永远不会发生,并且在单独使用SVN时不会发生。所以,我认为这是一个git-svn错误(我已经报道过这里) 。这反过来会产生问题,影响其他SVN用户,并在未来的提交中破坏合并信息。



我在寻找的是一种解决方法: / strong>我怎么能轻易地告诉git不要复制正在合并的分支的mergeinfo行,或者我怎么能告诉SVN在提交时删除那些自引用(或者任何其他解决方案,引用mergeinfo行,但保留自动svn:从git创建mergeinfo的其他品质)。



(为了澄清,我不是寻找人们向我引用git手册或告诉我与Git-SVN合并是危险的并且不被支持,请只回答您是否可以帮助解决问题或提出替代工作流程。因为他们可能会允许我创建一个补丁来解决这个问题。谢谢!)


看起来像是您创建了一个补丁。



http://lists-archives.com/git/765571-git-svn-dcommit-avoid-self-referential- mergeinfo-lines-when-svn-pushmergeinfo-is-configured.html


In recent versions of git, the configuration svn.pushmergeinfo was introduced:

config key: svn.pushmergeinfo

This option will cause git-svn to attempt to automatically populate the svn:mergeinfo property in the SVN repository when possible. Currently, this can only be done when dcommitting non-fast-forward merges where all parents but the first have already been pushed into SVN.

We're using this to have a mixed environment where some developers use SVN and some use Git-SVN. This works great when branching and merging SVN-branches in Git and then git svn dcommit-ing back to SVN, and it actually correctly populates the mergeinfo property in almost all cases. However, in specific situations it does so incorrectly.

This happens mainly when merging a branch into master (trunk), after having merged trunk into that branch (effectively, the equivalent of a SVN reintegrate).

The merge from trunk to the branch adds a mergeinfo line for trunk on that branch (as desired), but the reintegrate-merge from the branch back to trunk copies that line into trunk's mergeinfo, effectively creating a self-referencing line in trunk's mergeinfo property that points to itself. As far as I know this self-reference should never happen, and doesn't happen when using SVN alone. So, I consider this a git-svn bug (which I've reported here). This in turn creates problems down the road which affect other SVN users and corrupt the mergeinfo on future commits.

What I'm looking for is a workaround: how can I easily tell git not to copy mergeinfo lines for the branch being merged into, or alternatively how can I tell SVN to remove those self-references upon commit (or any other solution which doesn't result in a self-referencing mergeinfo line but does preserve the other qualities of automatic svn:mergeinfo creation from git).

(For clarification, I am not looking for people to quote the git manual to me or tell me that "merging with Git-SVN is dangerous and not supported". Please only answer if you can help with the issue or propose an alternative workflow. Pointers into the relevant git code would also be helpful since they might allow me to create a patch to solve this. Thanks!)

解决方案

just an update. looks like you created a patch.

http://lists-archives.com/git/765571-git-svn-dcommit-avoid-self-referential-mergeinfo-lines-when-svn-pushmergeinfo-is-configured.html

这篇关于Git-SVN与svn.pushmergeinfo:如何避免自引用mergeinfo行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆