Marcin Barabasz

imagination is more important than knowledge… A. Einstein


Leave a comment

Using WinMerge to compare SSIS in Visual Studio git

Comparing SSIS in VisualStudio can be a real pain in the ass. What can we do to make it just a little bit better? One answer would be use a powerful diff tool like WinMerge. But how to do it for source control files. If you are using TFS this is not hard, because there is a setting to choose own diff app in Visual Studio settings. Unfortunately for git it is not in UI anywhere. It is configurable, but a little more hidden.

If your project is already configured to use git as source control, navigate to project root using windows explorer and locate .git folder. In it you will find file called config with simmilar content to this one:


[diff]
 tool = vsdiffmerge
[difftool]
 prompt = true
[difftool "vsdiffmerge"]
 cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\IDE\\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t
 keepbackup = false
 trustexistcode = true
[merge]
 tool = vsdiffmerge
[mergetool]
 prompt = true
[mergetool "vsdiffmerge"]
 cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\IDE\\vsdiffmerge.exe\" \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" //m
 keepbackup = false
 trustexistcode = true

To change a default diff tool just add another [difftool] and [mergetool] sections and change tool= <name> to the name of tools you just defined.


[diff] 
tool = winmerge 

[difftool "winmerge"]
cmd = \"C:/Program Files (x86)/WinMerge/WinMergeU.exe\" -e $LOCAL $REMOTE

That’s it really after saving this file your default diff tool will be winmerge.

To really benefit from using WinMerge for SSIS there is another trick available. WinMerge contains feature to ignore lines specified with regex expressions. This feature is called “line filters” more about it here http://manual.winmerge.org/Filters.html. For SSIS especially useful would be:

(width|height|top|left|x|y)="-?\d{1,10}"
\{.{36}\}
ddsxmlobjectstreaminitwrapper binary=".{1,24}"
<DTS:Property DTS:Name="VersionBuild">-?\d{1,10}</DTS:Property>

 

Enjoy!