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

查看:77
本文介绍了合并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的元素的位置.例如,在proj文件上进行每次保存操作后,Configurations Debug和Release可能会交换顺序.这样就不可能轻松地合并每个开发分支的更改,甚至不考虑自动合并.

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.

我可以假定Microsoft正在使用一些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.

欢迎其他任何想法.

推荐答案

我创建了一个工具来比较和合并解决方案文件( 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天全站免登陆