The ident program allows you to find out what revision of source code was used compile a program. It is part of the RCS suite of tools, and works with CVS as well.

ident is intended to be used with the keyword substitution feature of RCS/CVS. When a string of the form $keyword$ appears in a source file under revision control, RCS/CVS expands it to include revision information. For example $Id$ could be expanded to $Id Makefile,v 1.42 2001/03/23 17:33:01 andrew Exp $.

ident simply scans a file for $...$ patterns and prints them out. It works with both text and binary files, so if the revision information is embedded in the binary with a line like
static const char cvsid[] = "$Id: BServer.cpp,v 1.2 2001/03/29 18:01:27 andrew Exp $";
the revision information can be recovered from the executable. Try "ident /usr/bin/rcs" to see this in action.

Here is a list of the keywords recognized by RCS/CVS and ident:

  • $Author$ - The login name of the user who checked in the revision.
  • $Date$ - The date and time the revision was checked in.
  • $Header$ - A standard header containing the full pathname of the RCS file, the revision number, the date and time, the author, the state, and the locker (if locked).
  • $Id$ - Same as $Header$, except that the RCS filename is without a path.
  • $Locker$ - The login name of the user who locked the revision (empty if not locked).
  • $Log$ - The log message supplied during checkin. For ident's purposes, this is equivalent to $RCSfile$.
  • $Name$ - The symbolic name used to check out the revision, if any.
  • $RCSfile$ - The name of the RCS file without a path.
  • $Revision$ - The revision number assigned to the revision.
  • $Source$ - The full pathname of the RCS file.
  • $State$ - The state assigned to the revision with the -s option of rcs(1) or ci(1).

Log in or register to write something here or to contact authors.