TFS: Automatically insert Check-In comments into source-code
TFS is in most cases very wonderfull. But if you have projects, which will also be used “outside” of the TFS environment (for example in an other subsidary without TFS access), then it has one disadvantage:
The comments for every check-in is only stored in the TFS version history.
While this is enough, if you always have access to the TFS. But if you work without TFS, then it would be helpfull if these comments are also included in the source-file (like in the old days, when we were using cvs (a feature called keyword-substitution)
I searched the web for any plugin for TFS which has almost the same features… but could not find any plugin….
So I wrote my own plugin, which at least puts the check-in comments into the source-file.
You just need to install this plugin and activate it in the “Check-In policy”.
Then your source-file will contai the comment, after you checked it in:
/* * $log$ * * Comment: And another test * with a multiline * comment... * User: xyz * DateTime: 2009-07-23 22:05:24 * Change: edit * * Comment: This is an test * User: xyz * DateTime: 2009-07-23 21:01:22 * Change: add, edit * */
I can also customize (like templates) the position and contents of the comments…
If you are interested in this plugin-in, please let me know…
Just a small addition: Here is a post about “keyword expansion” and TFS; and possible side-effects:
http://blogs.msdn.com/buckh/archive/2007/07/07/keyword-expansion-in-tfs.aspx
EDIT: 2009-08-08:
Today I published my first release of the LogSubstPol on CodePlex.
July 27th, 2009 at 23:58
Cool stuff! Would you ever consider putting this on a shared code site, like CodePlex? I’m sure there are a good number of other people that could benefit from this.
July 29th, 2009 at 21:02
how can I get the plugin?
August 8th, 2009 at 13:47
[…] Jochen Kalmbach’s Blog Infos about Windows development and dotNET Framework « TFS: Automatically insert Check-In comments into source-code […]
August 10th, 2009 at 16:28
[…] I saw a blog post by Jochen Kalmbach where he was talking about a check-in policy he wrote to support the keyword expansion […]
August 10th, 2009 at 18:03
[…] I saw a blog post by Jochen Kalmbach where he was talking about a check-in policy he wrote to support the keyword expansion […]
August 12th, 2009 at 09:44
[…] voila! Two years after this post was published, there appears TFS keyword expansion checkin policy, written by Jochen Kalmbach. Jochen also published the policy on CodePlex site, under the […]
September 2nd, 2009 at 14:12
Great work Jochen. I have been waiting for this plug-in since we left VSS.
Will this work for VS 2005 and VS 2010 too? (We have C++ apps with VS2005, ASPX Apps with VS 2008 and WCF Apps with VS2010 - all in the same project
September 2nd, 2009 at 14:20
Hi!
It should work.. but you need to recompile it with the according VS-Version…
September 3rd, 2009 at 16:06
Thx 4 the quick reply. I have it working on VS 2010 after a recompile. But VS 2005 is tough. Your code is .net 3.5 and I needed to rewrite it to 2.0 However, now I’m getting a cast exception
I probably added a bug somewhere. If anyone has this running on VS 2005 - any feedback would be helpful. I need to get some other work done…