views:

498

answers:

3
+2  Q: 

TFS: Email diffs

Eric suggests that you read your team's diffs every morning. Can I get TFS to automate this in some way? Ideally I'd like an email with all of the differences in, but I'd settle for a link to each of the commits.

+1  A: 

Have you explored setting up a report on the project portal that would show diffs based on date? I haven't done this (and I'm at home now so I can't investigate it), but I know that there is a lot of information you can get out of the portal. Whether you can get code diffs, I don't know.

The other alternative would be automating something with tfsadmin or the power tools. Again, not at work so I can't look at it, though the power tools seem like they may make it possible to do what you want from the docs.

tvanfosson
A: 

A quick solution would be to configure project alerts to send you one email per changeset.

Filter these into a separate folder in your email client, and review them at your leisure.

Ian Nelson
+2  A: 

As someone who works for Eric and who has the behaviour of checking the diffs each morning let me explain what I do. I'd like to think that I was one of the people he was thinking about when he wrote the post, but I know for a fact that he didn't know I did the diff checking each morning :-)

In Eclipse I use the Team, Synchronize... functionality to compare my local workspace with the latest on the server. As I do a get latest frequently, this tells me what has happened since I last did this (i.e. what changed while I wasn't looking).

In Visual Studio, I can do a similar thing by right clicking on the root folder of the area that interests me and selecting Compare... and then doing a compare of the Workspace version with the latest version.

Alternatively, you can just do a "History..." on the folder that is of interest and a brief scan down the history view will show you what has been happening and you can go look at what is interesting. It also encourages you to leave good check-in comments, and to encourage your developers to do the same :-)

I used to have email alerts configured for each check-in (Team, Project Alerts...), but I just ended up ignoring them most of the time. I even have a robotic rabbit configured to talk to me when someone does a check-in or runs a build - but this is only useful during the day, not checking what has happened the previous day while I was asleep (I live in a different time-zone to the rest of my colleagues so they do a lot of work while I sleep and vice-versa, making the practise of diff-checking even more useful)

In theory it would be possible to write a program that did generate you a diff each day between the latest version and your workspace version, however I've never bothered myself. This is partly because as I find the most value of the practise comes in exploring the changes that were made each day rather than just reading about them. I also admit that I wasn't aware that anyone else in the world was doing this daily diff routine - I figured I was alone in my code voyerisum, but obviously not!

UPDATE Feb 12, 2009: The following blog post just came to my attention.

http://blogs.msdn.com/abhinaba/archive/2008/07/07/auto-generating-code-review-email-for-tfs.aspx

It talks about (and provides source for) a tool called CRMail that will generate an email from a shelveset that will contain links back to Team System Web Access to show the diffs for each change in the changeset. It would be possible to modify this source to get it to show you diffs between changesets if you wanted to. Then you would just need to hook it up to run either as a nightly scheduled task or on every check-in by subscribing to the check-in event from TFS.

Martin Woodward