tags:

views:

32

answers:

2

Hi, I would like to know if it's possible, eventually by developing somethng using the SDK, to provide a check-in comment automatically when checking-in in TFS.

UPDATE: I tried using the SDK API like so:

TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(tfsName); tfs.EnsureAuthenticated(); VersionControlServer versionControl = (VersionControlServer)tfs.GetService(typeof(VersionControlServer)); versionControl.CommitCheckin += VersionControlOnCommitCheckin;

But the event does not seem to be fired. Is there anything blatantly wrong I'm doing?

A: 

Without knowing anything about TFS, that sounds like it runs counter to the purpose of having a commit comment. You're supposed to include useful high-level information in a check-in comment about why things have changed. If people just want to know what has changed, they can look at diffs. Automatically generating a comment would seem to be defeating the point.

Gian
I agree in spirit, Gian. However, there are times (as I mentioned in my answer) where you need to show that the checkin occurred outside of normal human interaction.
Robaticus
A: 

Both the SDK and the command line allow you to specify the check-in comment. If you're looking at doing this when the person checks in from within Visual Studio, you'll have to look at some automation, but, with VS2010, it should be relatively straightforward using DTE/MEF.

We have a couple automated processes that do check-ins, and we specify the comment to indicate that the check-in occurred as part of an automated process.

Robaticus