Is it possible to use WinMerge inside Visual Studio 2008 and Visual Source Safe 6.0? - visual-studio

I would like to use WinMerge as the default diff tool inside VS2008 from the solutions explorer in place of the "Compare..." context menu item. Is this possible? I'm looking for a quick replacement of the current bland diff tool an I just like WinMerge better. I'm not interested in going to the folder explorer and doing the comparison there.
I'm using Visual Source Safe 6.0 not TFS

Yep, it's possible!
See this link: http://whyiamright.wordpress.com/2008/01/18/changing-the-diffmerge-program-used-by-visual-studio/
Tools-> Options. In the tree, choose Source Control, then the plugin of your choice (VS team Foundation, Source Safe, etc).
Click the "Configure User Tools" button, click add, then specify the appropriate extension, operation, EXE, and arguments list.
This site: has the settings for many, including winmerge: http://blogs.msdn.com/jmanning/articles/535573.aspx
EDIT:
You mentioned VSS: Check out the Winmerge manual here: http://winmerge.org/docs/manual/VersionControl.html. It says how to do it about 1/5th the way down the page.

I think I have this working at a serviceable level if not optimal.
in visual studio go to tools > options > source control > plug-in settings
click the "advanced" button
in the sourcesafe options dialog, switch to the "custom editors" tab
for operation, select file difference
for file extension enter .*
for command line enter
"C:\Program Files\WinMerge\WinMergeU.exe" /x /e /ub /wl /dl %6 /dr %7 %1 %2
click the "add" button then the "ok" button.
using "compare" from a file's context menu or viewing history and selecting "diff" should bring up winmerge with the file comparison. the original is on the left and the modified file is on the right (is that the right placement? should they be swapped?). if you selected a highlighted difference, you can actually sync that area at this time as well. visual studio will just recognize the file has changed and ask you to reload. I haven't gotten to the situation where I'm in an actual "merge" situation so I'm not sure what happens there. I'll update this post if I ever have more info to add.
I'm using VS2008, sourcesafe 2005, and winmerge 2.12.4 installed to the default directory. I copied the settings from this post: http://weblogs.asp.net/garrypilkington/archive/2009/12/16/winmerge-as-a-comparison-tool-in-visual-studio-2008.aspx

I have been wondering about this as well and have not found anything to make it possible in VSS 6.0.
For now, it looks like the answer to our question is "No".

As I stated previously, I don't think we can integrate WinMerge with Visual Studio 2008 and VSS 6.0.
However, I did find that VSS 2005 is backward compatible with VSS 6.0 databases. So, if your server can't change from VSS 6.0, at least perhaps you can change your client to VSS 2005, and then follow the other instructions from the answers here.

Related

how to compare two files in visual studio ignoring casing

I want to compare two files in visual studio (files containing stored procs)
So I want to ignore all the "Capital" / "Small" differences in the file.
I opened the command window and used Tools.DiffFiles but its taking the case difference also into consideration
P.S I have already seen this question and answers for it
Although Visual Studio is asked for explicitly, I recommend a different tool: WinMerge.
It indeed has many options for comparing and merging files. It lacks a 3-way-merge though. Of course WinMerge can optionally ignore case.
Visual Studio can be configured so you can call WinMerge using "Tools / External Tools ...". Then you may even install a toolbar item for it. Quite nice!
Most version control systems allow you to use WinMerge as a compare tool. For example for TFS you open the "Tools / Options ..." menu and there you choose "Source Control / Visual Studio Team Foundation Server". Click on the button "Configure User Tools".

Can I use WinMerge as my merge/diff tool within Visual Studio?

I need to compare two files in my project, which is written in C#. Can I integrate WinMerge (or any other diff tool) with Visual Studio and use it easily from within?
There is a more detailed answer on paulbouwer.com life and technology
Replace diff/merge tool in Visual Studio Team System with WinMerge article, having also what arguments you need to pass.
I will reproduce it wholly, because I could not explain it better than him:
Replace diff/merge tool in Visual Studio Team System with WinMerge
JANUARY 31, 2010
I have been using Visual Studio Team System 2008 for a while now and am really starting to like the tightly integrated source control and work item functionality. One thing I cannot get used to is the basic diff/merge tool.
Where is the detail ?
The screenshot below demonstrates the basic nature of the diff tool built into Visual Studio Team System. There is no indication of the number of differences between the files being diff’ed or even the actual differences on a particular line …
WinMerge
There is an alternative and it is both open source and free ! From the WinMerge site:
WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.
Download WinMerge and install it.
Configure Visual Studio
Open Source Control > Visual Studio Team Foundation under the Tools > Options menu in Visual Studio.
Click on Configure User Tools … and the Configure User Tools dialog
will become available.
Add the WinMerge details for the Compare Tool. Click on the Add … button on the Configure User Tools dialog and configure as per the screenshot below. The arrow button next to the arguments text box exposes details about the information that Visual Studio can provide the tool being configured.
The configured arguments below are: /e /u /wl /wr /dl %6 /dr %7 %1 %2
Add the WinMerge details for the Merge Tool. Click on the Add … button on the Configure User Tools dialog and configure as per the screenshot below. The arrow button next to the arguments text box exposes details about the information that Visual Studio can provide the tool being configured.
The configured arguments below are: /e /u /wl /dl %6 /dr %7 %1 %2 %4
The Compare and Merge Operations should now be configured to use WinMerge.
WinMerge Command Line Options
WinMerge contains a number of command line options. The following are the ones used in the configuration above.
/e Enables WinMerge to be closed with a single Esc key press.
/u Prevents WinMerge from adding either the left or right hand side
file path to the Most Recently Used (MRU) list.
/wl Opens left hand side as read-only.
/wr Opens right hand side as read-only.
/dl Description for left hand side title bar.
/dr Description for right hand side title bar.
Finally a decent diff !
Now a Compare in Visual Studio is more meaningful, It shows the number of differences, their positions within the compared files and actual differences per line. WinMerge supports custom syntax colouring and diff colouring.
PERSONAL NOTE:
I tested it, and I couldn't make changes go to to my local file, so I followed the Youen's advice on that page of removing the /wr parameter for Compare operation and now it works nice!
I use WinMerge for comparing files and I integrated winmerge with visual studio. for this follow this instruction :
in visual studio select : Tools > Options
from this dialog select : Source Control > Visual Studio Team Foundation Server
here you must select Configure User Tools and then select Add. after that, from opened dialog box enter .* in Extension field and set Operation to Compare and into Command field enter WinMerge executable path and select OK.
that's all ;)

How can you see the difference between two files in Visual Web Developer 2010?

I've seen some SVN tools that use a "diff" command that will highlight the differences between two files. However, I don't understand how to do this within Visual Web developer 2010 (Express). Any help discovering this method will be greatly appreciated.
Thank you,
PS: I include visual-studio-2010 in the tags as I think it is the closest thing to web developer 2010.
I am not sure if VWD has its own file compare function, but you could use WinDiff from the Windows SDK. Here is the link for version 7.1 - http://www.microsoft.com/en-us/download/details.aspx?id=8279
Taken from http://msdn.microsoft.com/en-us/library/bb385990.aspx
To compare two files
On the View menu, click Other Windows, and then click Source Control Explorer.
In Source Control Explorer, right-click the version of the file that you want to
compare, and then click Compare.
NoteNote
As an option, you can right-click a file in Solution Explorer and then click Compare.
The Compare dialog box appears and the local path of the file that you selected is
in the Source Path box.
Enter the Target Path or click Browse and locate the target folder.
Under Target Version, select the Type you want to use for comparison: Changeset,
Date, Label, Latest Version, or Workspace Version.
Click OK.
If the files have no differences, the Microsoft Visual Studio dialog box appears,
informing you that the files are identical. Click OK.
Otherwise, a difference window displays the files side by side.
I use devart's code compare tool and it worked really good for me. You can download it from here.
http://www.devart.com/codecompare/

How to ignore white space when comparing source in Visual Studio / TFS?

The compare tool in Visual Source Safe (pre TFS) had a handy checkbox to select "Ignore White Space".
Now we are using TFS with Visual Studio 2010, and the compare dialog no longer has this option. (A ridiculous oversight from Microsoft!)
So, is it possible somehow to work around this?
This is a workaround that seems to get around the problem.
In Visual Studio, select Tools / Options / Source Control / Visual Studio Team Foundation System and click the Configure User Tools button.
In the dialog, Add an item with the following settings.
Extension : .*
Operation : Compare
Command : C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\diffmerge.exe
Arguments : %1 %2 %6 %7 %5 /ignorespace
Edit:
Depending on your Visual Studio version and instalation path (x64/x86), the command option may be...
VS2010: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\diffmerge.exe
VS2012: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\diffmerge.exe
VS2013: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vsDiffMerge.exe
VS2015: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\vsDiffMerge.exe
VS2017: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsDiffMerge.exe
In the argument option leave it with the same number of arguments as the VS suggests and just add /ignorespace in the end. For example, in the VS2015 it will be:
%1 %2 /ignorespace
There is a "=" button on Visual Studio 2017 toolbar that helps to compare files as you want. Hope this screenshot will help.
The default diff tool in Visual Studio is extremely annoying. I suggest you use an alternative.
WinMerge is my favourite. It also has an option to ignore whitespace (menu Edit -> Options -> Compare -> Ignore all (under the groupbox "Whitespace" at the top)).
See Using WinMerge with TFS.
In VS2015 it's possible to "ignore white space" when comparing clicking a little icon with the = symbol.
Go to "View/Toolbars/Compare Files". In the toolbar click on "Ignore trim whitespace".
Update 2020: we struggled a lot solving conflicts with VS comparison tool and the Tortoise SVN one, so after a research we decided to install Devart Code Compare (free version) which has integration with VS2015/2017/2019, SVN (Tortoise and Ankh), TFS, Mercurial, GIT, etc. and Windows Explorer, so no more nightmares/confusion between different comparisons tools. Give it a try, it's extremely useful. It has also Merge to solve conflicts and Folder diff, which is really useful when SVN does not merge for some reason. Also, clicking on the left/right arrows to copy the changes is a feature that I really like.
Below VS image is from Devart website, but in my case I setup Code Compare to open it outside VS instead of embedded, I think it behaves better. And in VS Options > Source Control > Subversion Environment, I have this:
The default diff tool in VS 2013 does let you ignore whitespace after all. Just run the standard differencing process. When Visual Studio brings up the differences, look on the toolbar, where you will see an icon that looks like a document with 5 dots under it, as shown below. This button toggles whether the displayed differences ignore white space. This worked well enough for me; I wanted it to ignore changes in the white space caused by indentation.
in VS 2012, this might be what you're looking for with no changes to Diff tool.
Opening up the compare screen in VS 2012 and at the top you see the following option in the toolbar. as it might be the same comparison as user: Master screenshot.

How to jump to a file in the Source Control Explorer in Visual Studio

I love the Solution Explorer > Right-click > "Open Containing Folder" feature of the PowerCommands extension for Visual Studio 2010. I want the equivalent of a "Jump to location in Source Control Explorer" feature. How can I find out the location in TFS of a given open file, or a file in the solution explorer (or a file in the solution navigator in you have the Productivity Power Tools extension)?
The best answer would be a couple of mouse clicks and no keyboard. Next best answer would be a hotkey mapping.
The only solution that I have found so far is to use the Productivity Power Tools extension which has the feature "Find in Source Control". A file in the results list can be right-clicked to "Open folder in Source Control Explorer". The drawbacks to this solution is that is takes many clicks, and the search results can match more than one file if files exist with the same name in different folders.
There is a stand-alone extension that you can download, called Locate in TFS, within Visual Studio.
"Locate in TFS" on TFS Gallery
"Locate in TFS" on GitHub
This also works on files that you "Exclude from source control", as many developers do with the web.config files.
psulek's post, above, mentions this as part of VSCommands, but I prefer the stand-alone extension.
Try Visual Studio extension VSCommands for Visual Studio 2012. It has feature called Locate in TFS. This will add new button to Solution Explorer Locate in TFS which opens active selected file/folder in TFS Source Control Explorer.
Feature request has been raised with Visual Studio team. Read here
I know it's probably too late. See TfsExt extension for vs2010
I'm not sure if it's possible, but it's a good suggestion.
These two examples show how to use the Visual Studio Extensibility APIs to access the TFS Source Control Explorer APIs.
http://blogs.msdn.com/b/edhintz/archive/2006/02/03/524312.aspx
http://blogs.msdn.com/b/bharry/archive/2008/07/09/working-on-tfs-sdk-improvements.aspx
For Visual Studio 2013 try lightweight extension TfsExt13

Resources