What does doxygen's $Id: ... $ mean
Asked Answered
S

1

6

I'm looking at a doxygen code example and seeing the following.

/**  
  @file test.h  
  @brief Define helper functions  
  $Id: test.h,v 1.10 2012/10/10 10:10:10 author Exp $  
*/ 

Can anyone explain what does $Id: do here?

Thanks

Schuh answered 12/11, 2012 at 18:15 Comment(2)
Hmm. That ,v looks suspiciously like a CVS file identifier. I haven't used CVS for years and years though, so I don't have any repositories left to check! Have a look at the top of this file for a similar example.Etom
That is a version control id, CVS, SVN or other. The version control mechanism would automatically update that information when you commit some changes. It isn't specific to doxygen either.Jerrybuilt
D
10

That's not a doxygen line at all. That's a source-control command character telling it to substitute in version information so you can see in the source which committed version you're working with. See http://www.badgertronics.com/writings/cvs/keywords.html

Dd answered 12/11, 2012 at 18:25 Comment(3)
So do I add '$Id: $' before I import my files into repository? ThanksSchuh
The $Id: $ syntax is used by RCS, CVS, and (optionally) SVN. Yes, you add $Id: $, or just $Id$, to your source file before checking it in; checking it out automatically expands it.Octameter
You may also have to manually tell the source control system to do keyword substitution in order for it to place this information in the tag. e.g. for SVN see (wiki.preshweb.co.uk/doku.php?id=svn:propset)[http://… something like "svn propset svn:keywords 'Id' test.h" You can also set it up in the [auto-props] section of your .subversion/config file to atutomatically add this property to new files, with lines like "*.h = svn:keywords=Id"Aircraftman

© 2022 - 2024 — McMap. All rights reserved.