Fog Creek Software
Discussion Board

SourceSafe Question

the unix source control systems I used in college (RCS & CVS, I think it's been a couple of years) had a feature where you could insert a macro in a comment block of your source file, so that when you checked a file in/out the macro would get replaced with the version #, date, etc...

I assumed this was a basic feature of Source Control.  However, after working with VSS for a while, I haven't found any way to do this. 

Am I missing something, or is this (yet another) reason to dump VSS and switch to an alternate system?

Sunday, February 16, 2003

From VSS Help:

keyword expansion

Process VSS uses to replace a VSS keyword with meaningful header information when you use the Check In and Add Files commands.  For example, the string "$Revision:  $" tells VSS to expand the Revision keyword automatically with the current file version number.

There should be a list of the other keywords somewhere.


Sunday, February 16, 2003


thanks, sgf

Sunday, February 16, 2003

Note that you need to ENABLE keyword expansion (on the SourceSafe SERVER) for each of the file extensions where you want the keyword information updated. SourceSafe also has fixed-length and variable-length keyword expansion, specified by "::" and ":" in the keyword.

In VB and ASP source files, I use comment headers and footers that include SourceSafe keywords, similar to the following:

At the top of the source file:
' Copyright (c) 1997-2003 [company name goes here]                          $
' All rights reserved.  [header section updated by SourceSafe; do not edit] $
' $Archive:: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx                  $
' $Workfile:: xxxxxxxxxxxxxxxxxxxxx                  $  $Revision:: nnn    $
' $Author:: xxxxxxxxxxxxxxxxxx                $  $Date:: xxxxxxxxxxxxx    $
' Revision history is located at the end of the file.                      $

At the bottom of the source file (not included in ASP files):
' $History:: xxxxxxxxxxxxxxxxxxxxx                                          $

Philip Dickerson
Monday, February 17, 2003

Check out:

source safe junkie
Tuesday, February 18, 2003

*  Recent Topics

*  Fog Creek Home