Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Explaining tf diff

Using Visual Studio 2008 tools,

I am trying to get an ASCII diff of change sets 14318 and 14317.

I can do so using GUI:

tf changeset 14318

and then select a file and right-click and select compare with previous version. However, this is a bit tedious and it is GUI-based. My task at hand is to back-port many changes into a different branch. I would like to automate the testing (say using Python), making sure that I did it correctly. Well, for educational purposes I will make all changes by hand without looking at the solution, and then I will compare the two changes and try to look for any differences. Here is what I love about tf - I can type:

tf changeset 14318 > out.txt&&notepad out.txt

to view the details of what files were affected.

Similarly, I wish to get an out.txt with all the differences saved in it. I am pretty sure that I can handle the Python part. I definitely want to know how to do it using the tf.exe tool, but if you also happened to know other tricks for accomplishing this (some cool 3rd party tool, or PowerShell script, then please let me know as well).

Thank you!

Oh, by the way, I checked this: http://msdn.microsoft.com/en-us/library/6fd7dc73(VS.80).aspx

And I tried this:

tf diff 14318 14317

And I have gotten this error: File (or folder) c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\14318 does not exist.

Now thank you.

EDIT: Are there any tools at all that can do this?

like image 554
Hamish Grubijan Avatar asked Jan 28 '10 23:01

Hamish Grubijan


1 Answers

You're just not using the correct syntax when calling it. In this case, it tried to do a diff between your working copy, and the base repository version, of (non-existing) files 14318 and 14317.

What you need to do instead is to use a changeset range in /version, like this:

tf diff $/Foo /version:C14317~C14318 /recursive /format:unified > foo.diff

Note that you can use ~ with any other version specs - labels, dates etc. See here for details.

like image 112
Pavel Minaev Avatar answered Sep 21 '22 02:09

Pavel Minaev