本文介绍了可以将CVS和Subversion设置为在合并时忽略空格吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CVS和Subversion都具有方便的合并功能,因此当您更新已修改的源文件时,它将合并其他人对该文件所做的更改。

CVS and Subversion both have a handy merge feature so that when you update a source file that you have modified, it merges in changes that others have made on the same file.

但是,如果您所做的更改与其他更改不兼容(通常,如果您都更改了代码的相同部分),则会产生冲突。这两段源代码都将包含在合并的文件中,您需要手动找出要保留的更改。到目前为止,一切都很好。

However, if your changes and the other ones are incompatible - generally if you have both changed the same parts of the code - it will create a conflict. Both stretches of source code will be included into the merged file and you need to manually sort out which changes to keep. All fine so far.

我的问题是,我们中有些人使用不同的开发环境(如果必须知道,则使用Netbeans与vi),并且Netbeans具有自动缩进功能-缩进代码。因此,当我们合并更改时,有时会遇到巨大的冲突,这些冲突主要是由缩进的简单更改引起的,而不是真正的代码更改。这些通常会造成数百行明显的冲突,必须手动解决,但通常只能归结为几行实际更改。当某人的编辑者将unix更改为Windows换行符时,也会发生类似的情况。

My problem is that some of us use different development environments (Netbeans versus vi if you must know) and Netbeans has an auto-indenting feature which re-indents the code. Therefore, when we merge changes, we sometimes get huge conflicts which are mostly caused by simple changes in indentation and are not genuine changes to code. Often these create hundreds of lines of apparent conflicts which have to be manually resolved, but usually they come down to just a few lines of real changes. A similar situation occurs when someone's editor changes unix to Windows newlines or vice versa.

所以-在比较两个版本时,我可以设置合并忽略这些冲突吗? Diff具有--ignore-space-change或-b选项,我希望在cvs或svn中具有基本相同的功能。我们在不同的项目上使用每种工具,因此我很乐意为这两个问题中的一个或两个给出答案。

So - can I set merge to ignore these "conflicts" when comparing the two versions? Diff has the --ignore-space-change or -b option and I would like to have essentially the same feature available in cvs or svn. We use each tool on different projects so I would be happy to have the answer for either or both.

最后两个注意事项:


  • 显然,合并过程必须对在合并文件中使用哪个版本的空格做出任意选择。对此我表示满意-我们以后随时可以重新格式化。

  • 我可以通过更加纪律严明和更频繁地检查来避免其中的一些问题-公认并能理解。但是我并不完美。

推荐答案

对于SVN:在命令行工具中,可以使用 -x ,您可以将其设置为 b w 以忽略空格更改。所有空格。

您还可以提供用于进行合并的第三方工具。因此,如果您有忽略空白的合并,则可以使用此合并。与往常一样,
TortoiseSVN是所有参数的前端,因此它也支持忽略空格。

For SVN: In commandline tool, there is the option -x which you can set to "b" or "w" to ignore space changes resp. all spaces.
You can also supply a third party tool for doing the merges. So if you have a merger which ignores whitespaces, you can use this one.TortoiseSVN, as always, is a frontend to all parameters, so it will support for ignoring whitespaces as well.

。您需要的选项是-diff3-cmd

这篇关于可以将CVS和Subversion设置为在合并时忽略空格吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 20:06