Thursday, July 19, 2007

Visual Source Safe (VSS) File Headers

Applies to VSS 6.0c and above

Most Architects or Tech Leads needs to set up the VSS for the solution. Though VSS does keep track of all the changes to the files. It would be great if we can immediately find out who was the last person who edited the file. This way we can bug him when something goes wrong with the compilation.


On a personal front the headers does give a great look and feel to the code (green color on top) which I adore.

In order to use it you will need to know what are called VSS Key words.

Since VSS considers these an extra burden (dont know why, when these guys want a comment before check out which I find absurd) we also need to know what is VSS Key word expansion.

Add the header like this.

/******************************************************************
// Project Name : Your Project or product name
// File Name : $Workfile: $
// Created By : Anton
// Description : Base Class for Data Access Layer.
// =========================================================
// Last Modified by : $Author: $
// Date : $Date: $
// Revision No. : $Revision: $
*******************************************************************/

The test $Workfile, $Author, $Date, $Revision are all key words.


You will aslo have to do some changes to the VSS admin.

Login in to the database that you need the keyword expansion.

On the Tools -> Options

You will notice

a text box for Expand Keywords in files of Type
Enter *.cs

if you want this for more than one file type
Enter *.cs,*.xslt

And viola you are ready.

This will expand to the following after check - in

/*****************************************************************
// Project Name : Your Project or product name
// File Name : $Workfile: DataAccessBase.cs $
// Created By : Anton
// Description : Base Class for Data Access Layer.
// =========================================================
// Last Modified by : $Author: Anton $
// Date : $Date: 8/18/05 8:09p $
// Revision No. : $Revision: 3 $
*****************************************************************/

Happy Programming
Anton

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home