How can I get changeset comments with the merge candidates from a TFS command line command?

Viewed 1464

I would like produce a list of merge candidates between two branches that includes the changeset comments in a format that I can copy paste in an email.

I know I can do this tf command:

tf merge /candidate $/Branch1 $/Branch2

Which returns something this:

Changeset Author                           Date
--------- -------------------------------- ----------
   22282  developer1                       08/09/2012
   22354  developer2                       08/14/2012
   22361  developer2                       08/14/2012
   22365  developer2                       08/14/2012
   22381  developer3                       08/15/2012

However, I'd like to get the comments as well. The Merge Wizard does something similar when doing a "Selected changesets" merge. Here is an example:

enter image description here

I was thinking that I might be able to combine tf merge /candidate in some way with this command:

tf changeset /noprompt 12345

Which outputs something like this:

Changeset: 12345
User: developer1
Date: Thursday, August 09, 2012 5:20:01 PM

Comment:
  Completed various things

Items:
  merge, edit $/Branch1/BreakFreely.asmx.vb
  merge, edit $/Branch1/FreelyBroken.vb

Work Items:
  ID    Type                State Assigned To  Title
  ----- ------------------- ----- ------------ -----------------------------------------------------------------------------
  21406 Sprint Backlog Task Done  JoDeveloper1 Fix various things

Check-in Notes:
  Code Reviewer:
    Complete Lyblind

In short, my desired outcome is something like this:

Changeset Author                           Date       Comment
--------- -------------------------------- ---------- --------------------------
   22282  developer1                       08/09/2012 Fixed random stuff
   22354  developer2                       08/14/2012 Fixed specific stuff

What do you think?

1 Answers
Related