views:

404

answers:

5

Frequently I come across the following statements in C/C++ source code:

$Id: lzio.c,v 1.24 2003/03/20 16:00:56 roberto Exp $

$Id: file name, version, timestamp, creator Exp $

Have you got any idea which software produces those "signatures"?

+5  A: 

Version control systems such as CVS can produce such tags.

0xA3
I think that probably most tools do support including CVS, SVN (subversion), Perforce, Git, Mercurial.
Sorin Sbarnea
+2  A: 

Both RCS and CVS produce strings that look exactly like that.

Darron
+2  A: 

I've seen a few vim setups that will auto-magically populate these values. SVN can grab these values on pre and post commit hooks to fill default information in commit logs.

Cory Collier
A: 

Perforce supports some (not sure about all) of those key words.

Peter K.
+2  A: 

Keyword substitution in subversion produces this sort of information, in particular Id:

Id

This keyword is a compressed combination of the other keywords. Its substitution looks something like $Id: calc.c 148 2006-07-28 21:30:43Z sally $, and is interpreted to mean that the file calc.c was last changed in revision 148 on the evening of July 28, 2006 by the user sally.

You can tell subversion to insert these values using svn:keywords

To tell Subversion whether or not to substitute keywords on a particular file, we again turn to the property-related subcommands. The svn:keywords property, when set on a versioned file, controls which keywords will be substituted on that file. The value is a space-delimited list of the keyword names or aliases found in the previous table

You can also make these substitutions automatic by editing your config:

Subversion also provides the auto-props feature, which allows you to create mappings of filename patterns to property names and values. These mappings are made in your runtime configuration area. They again affect adds and imports, and not only can override any default MIME type decision made by Subversion during those operations, they can also set additional Subversion or custom properties, too. For example, you might create a mapping that says that any time you add JPEG files—ones that match the pattern *.jpg—Subversion should automatically set the svn:mime-type property on those files to image/jpeg. Or perhaps any files that match *.cpp should have svn:eol-style set to native, and svn:keywords set to Id. Auto-prop support is perhaps the handiest property related tool in the Subversion toolbox. See the section called “Config” for more about configuring that support.

Ken
+1 for being better than the accepted answer...
genehack