合并 vcproj 文件 - SCM 的地狱 [英] Merging vcproj files - SCM's hell

查看:12
本文介绍了合并 vcproj 文件 - SCM 的地狱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

合并项目/解决方案文件是开发人员/SCM 管理员在其源代码控制中执行合并的众所周知的灾难.

Merging project/solution files is a well-known disaster among developers/SCM admins performing merges in their source control.

以一个常见的场景为例:开发是在两个不同分支的项目/解决方案上完成的.当需要合并回主要开发线时,VCPROJ(和 SLN)之间的相似之处非常小.

Take, for example, a common scenario: development is done on a project/solution in two different branches. When time comes to merge back into a main development line, there is a very small resemblance between the VCPROJ's (and SLNs).

原因是,Visual Studio 可能会更改(并且确实会更改)这些文件中各种类似 XML 的元素的位置.例如,配置 Debug 和 Release 可以在对 proj 文件的每次保存操作时交换顺序.这使得无法轻松合并来自每个开发分支的更改,甚至不考虑自动合并.

The reason is, Visual Studio may change (and DOES change) location of the various XML-like elements within these files. E.g., Configurations Debug and Release may swap order upon every save operation on the proj file. This makes it impossible to easily incorporate changes from each development branch, not even considering an automatic merge.

我可以假设微软正在使用一些 perl 散列系统来保存 vcproj 结构,因此保存操作时文件的呈现不是有序的.

I can assume that Microsoft are using some perl hashing system to hold the vcproj structures, hence the rendering of the files upon a save operation is not ordered.

我首先想问:有没有人找到一些优雅的方法来解决这个问题?

I'd first like to ask: did anyone found some elegant method to workaround this?

其次,我想提两个建议:

Second, I'd like to make two suggestions:

  • 请让 Microsoft 重新实现上述文件,并将它们限制为某些元素的严格排序.

  • Have Microsoft please reimplement the above files and restrict them to some rigid ordering of elements.

找到一个工具(或编写一个),按字母顺序、递归(元素中的所有元素等)对 vcproj(xml 格式)和 sln(sln 格式...)文件进行排序.在源文件和目标文件上使用此工具可以轻松指出(和合并)更改,希望 Visual Studio 读取已排序、合并的项目或 sln 文件.

find a tool (or write one) that sorts vcproj (xml format) and sln (sln format...) files alphabetically, recursively (all elements within elements etc.). Using this tool on both source and target files would enable to easily point (and merge) the changes, hoping that Visual Studio reads the sorted, merged project or sln file.

欢迎任何其他想法和想法.

Any other ideas and thoughts are welcome.

推荐答案

我创建了一个工具来比较和合并解决方案文件 (http://slntools.codeplex.com).与通用合并"相比,将解决方案与工具合并要容易得多.它无法处理项目文件.

I created a tool to compare and merge solution file (http://slntools.codeplex.com). It's a lot easier to merge a solution with the tool compared to a 'generic merger'. It cannot handle project files thought.

这篇关于合并 vcproj 文件 - SCM 的地狱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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