1

Is there a way to find the number of lines of code changes(from the latest version in the server) in a TFS shelveset. I want this for code review purpose to find the total ELOC for a particular shelveset file.

Kris
  • 640
  • 1
  • 11
  • 28

1 Answers1

1

You can get a diff between two versions with tf diff.

Eg.

tf diff the.file /format:unified /version:c1000~c1001

will show the diff on the specified file between changesets 1000 and 1001, which can be parsed to count changed lines (to whatever definition you want to use such as not counting whitespace only changes).

Note:

  • Multiple formats are available, some might be better for parsing (see help for details).
  • You can use various formats for versions (eg. version in the current workspace and latest): again see help.
Richard
  • 106,783
  • 21
  • 203
  • 265
  • Won't this show only the difference between two files. But at last i have to count the number of lines of code changes manually by looking the difference between both(which I am currently doing). – Kris Apr 04 '12 at 17:40
  • @Kris Indeed -- the step I meant to include was to then process the diff output (hence the comment on different diff formats). – Richard Apr 04 '12 at 21:53