问题
Visual Studio has a fantastic internal diff tool: https://www.visualstudio.com/en-us/docs/tfvc/compare-files
I'm using Perforce in Visual Studio via the P4VS plugin. The plugin adds the "Diff" sub-menu when you right-click on a file's tab. But by default any diff operations are carried out by P4M, rather than using Visual Studio's internal diff tool:
To it's credit, P4VS does allow for the selection of a different diff app. But the provision is for a command line operation. I don't know how to make it use the current instance of Visual Studio's diff tool. Is there a way to do that?
回答1:
You can absolutely use Visual Studio's Diff tool! You just need to run devenv with the /diff
option: https://msdn.microsoft.com/en-us/library/jj874068.aspx
Doing so will spawn the diff in the current Visual Studio instance.
To set this up in the "Default diff application" section of the "Source Control" > "Perforce - Diff/Merge" options dialog that you specify in your question:
- Select "Other"
- In "Location" specify the path to your devenv.exe (default path is: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe")
- For "Arguments" use "/diff %1 %2"
So your dialog will look something like this:
来源:https://stackoverflow.com/questions/43185880/using-the-built-in-visual-studio-diff-tool-to-view-p4vss-diffs