"$Id: index.html,v 1.46 2004/08/19 23:15:05 grog Exp $" ?

Greg 'groggy' Lehey grog at FreeBSD.org
Sat Oct 2 00:40:05 PDT 2004

[redirected to FreeBSD-questions; this is a technical issue]

On Saturday,  2 October 2004 at  0:10:40 -0400, robg wrote:
> Hi:
> I see this at the end of a lot of documents:
> $Id: index.html,v 1.46 2004/08/19 23:15:05 grog Exp $
> or something similar.  How is that done?  Is it done from a text
> editor that just appends it by itself?

This comes from RCS or CVS.  I'll talk about RCS below, because it's

> How would I go about doign it?

Start with a file with just $Id$ in it.  This file is obviously called
index.html (in fact, to judge by the date and revision ID, it's the
current version of my home page,
http://www.lemis.com/grog/index.html).  Then check it in with the ci

  $ ci -u index.html
  index.html,v  <--  index.html
  enter description, terminated with single '.' or end of file:
  NOTE: This is NOT the log message!
  >> Home page
  >> ^D
  initial revision: 1.1

If you now look at the file, the $Id$ will have changed to (in this
case) $Id: index.html,v 1.1 2004/10/02 05:29:27 grog Exp $.

When you then want to update the file, you first need to check it out
(the version you have is write-protected).  Do this with:

  $ co -l index.html

Make your changes; when you're done, check in again with ci:

  $ ci -u index.html
  index.html,v  <--  index.html
  new revision: 1.2; previous revision: 1.1
  enter log message, terminated with single '.' or end of file:
  >> Added text
  >> ^D

The text after >> gets put into the revision log.  You can look at it
with rlog:

  $ rlog index.html
  RCS file: index.html,v
  Working file: index.html
  head: 1.2
  locks: strict
  access list:
  symbolic names:
  keyword substitution: kv
  total revisions: 2;     selected revisions: 2
  Home page
  revision 1.2
  date: 2004/10/02 05:33:39;  author: grog;  state: Exp;  lines: +2 -1
  Added text
  revision 1.1
  date: 2004/10/02 05:29:27;  author: grog;  state: Exp;
  Initial revision

You can also check out older versions and compare things; somewhere
there must be a tutorial.  One thing you should note is that for any
file index.html, the "control file" (that contains all the revisions
and the logs and things) is called index.html,v.  By default it gets
put in the same directory as the file you're tracking, but if you have
a subdirectory RCS (which I recommend), it'll get put there instead.

See complete headers for address and phone numbers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20041002/ca09127a/attachment.bin

More information about the freebsd-questions mailing list