简体   繁体   中英

How to diff changed form file - ( .Designer InitializeComponent )

Using Suversion and WinDiff its no problem to branch / merge class-projects and web-projects.

The only kind of project I can never merge are winform projects. The InitializeComponent method is always scrambled after only little changes.

Is there any good way to enable diff / merge for .Designer - files?

EDIT:

I used a 3 way diff like Bert suggested. It made things a lot more easy. But still Winform - files (.designer and .resx ) were not mergeable.

We have a different method of ensuring that diffs are a bit more managable. We have a trigger on checkin that will modify the designer files InitializeComponent section into a consistent and ordered manner, so that diffs show the real changes.

we want to split InitializeComponent into 4 sections - creation, layout suspension, setup and layout resuming. Each of these sections are then separately ordered according to the names of the controls.

如果您正在使用 Resharper,请在签入之前重新格式化(包括对成员进行排序等等)这些文件。

Windiff was designed for comparing files. It uses a 2 way diff merge algorithm, that only allows you to see changes between two versions of a file, so you just have to guess which changes should be applied to a result file.

For merging you should really look into using a 3 way diff algorithm/tool.

In a 3 way diff the diff tool uses the original version of a file to extract the changes of your file (%mine) against the origin (%base) and their file (%theirs) against the origin and then applies all changes to the original version to create a single result. (And if there are any conflicts i

A very user friendly 3 way GUI diff tool that you can use for free is SourceGear DiffMerge (Recommended), but TortoiseMerge also implements a 3 way merge.

You can find a list of other common merge tools on Wikipedia .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM