views:

288

answers:

3

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 thinks a lot more easy. But still Winform - files (.designer and .resx ) were not mergeable.

A: 

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.

Bert Huijben
This is a good suggestion in general, but is not relevant to the designer file merging problem.
configurator
+1  A: 

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.

Colin Cassidy
Sounds nice. Can you show the trigger code?
Malcolm Frexner
I'll try and hunt it out
Colin Cassidy
@Colin, did you find that trigger code? I've got the same problem.
configurator
A: 

If you are using Resharper, reformat (including sorting members and whatever) those files before checking in.

skolima