Marcin Barabasz

imagination is more important than knowledge… A. Einstein

Using WinMerge to compare SSIS in Visual Studio git

Leave a comment

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!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s