Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Oct 2004 15:08:36 +0930
From:      Greg 'groggy' Lehey <grog@FreeBSD.org>
To:        robg <robg.list@gmail.com>
Cc:        FreeBSD Questions <questions@FreeBSD.org>
Subject:   Re: "$Id: index.html,v 1.46 2004/08/19 23:15:05 grog Exp $" ?
Message-ID:  <20041002053836.GN460@wantadilla.lemis.com>
In-Reply-To: <5c389d3b041001211056012a3f@mail.gmail.com>
References:  <5c389d3b041001211056012a3f@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--OQhbRXNHSL5w/5po
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

[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
easier.

> 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
command:

  $ 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
  done

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
  done

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
  branch:
  locks: strict
  access list:
  symbolic names:
  keyword substitution: kv
  total revisions: 2;     selected revisions: 2
  description:
  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.

Greg
--
See complete headers for address and phone numbers.

--OQhbRXNHSL5w/5po
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)

iD8DBQFBXj7cIubykFB6QiMRAoMQAJ4v4PQ5nV62OTrP6+sjvvxw5lUkkgCfVE/O
7uKJFzLEDFVnwvrRR+B2lp4=
=BkBq
-----END PGP SIGNATURE-----

--OQhbRXNHSL5w/5po--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041002053836.GN460>