ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hartmut Henkel <hartmut_henkel@gmx.de>
Cc: ntg-context <ntg-context@ntg.nl>
Subject: Re: Versionnumbers
Date: Thu, 12 Jul 2001 21:00:04 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.21.0107122026270.985-100000@hahepc1.hahe> (raw)
In-Reply-To: <3.0.6.32.20010712091736.019cd600@server-1>

You can put the macro call \scanrcs $Id$ into the source file whereever
you like, but regarding TeX, the \scanrcs macro has to be defined
before.

At the first time when you submit the file by ci, the string $Id$ will
be replaced by the expanded string (still delimited by `$Id' and `$')
with date, version number, etc. inbetween. Obviously only from that
moment on the simple macro below is working, because it expects the full
number of macro parameters.

The rcs system (consisting of programs ci, co, rlog...) itself does not
care where or how often it finds a string $Id$ or the expanded version
in a file. It simply replaces all occurences by updated, identical ones.
These strings need not be at file or line begin. E. g. you can simply
write %$Id$ to keep the string away from TeX.

There are other strings detected by rcs, like $Log$, $Revision$,
$Author$, $Date$ etc., which mostly produce substrings of the full $Id$
string. See the co man-pages.

There should exist also a LaTeX package for handling rcs, but I never
used it, since it is fun writing three lines of macro and seeing TeX
running over it :-)

I forgot: ci produces a repository file `,v', e.g. foo.tex,v, which
incrementally keeps ALL versions: The latest version is stored
literally, and older versions are stored incrementally as differences.
The automatic version number incrementing uses diff to detect file
changes. If you create a subdirectory `RCS' in the current directory,
repository files are kept there. The really good point about rcs is,
that you can recover any older file version by version number.

There is also the cvs system around, which puts a layer of functionality
on top of rcs, and allows managing repositories over the Internet.

Best Regards

Hartmut

On Thu, 12 Jul 2001, Hans Hagen wrote:

> At 11:03 PM 7/11/01 +0200, Hartmut Henkel wrote:
> >You might use `rcs', revision control system. This stamps your files
> >with an Id string, containing filename, -version, -date, creator...
> >
> >You submit e. g. the file foo.tex by ci foo.tex. You get the new version
> >for editing by typing co -l foo.tex
> >
> >In plain TeX the following macro scans the Id string, when you have
> >initially included a line \scanrcs $Id$ into your input file:
> >
> >% begin of file foo.tex
> >\def\scanrcs $#1 #2,v #3 #4/#5/#6 #7 #8 #9 ${%
> >  \def\fileversion{#3}
> >  \def\filedate{#4#5#6} % Or whatever date format you like
> >  }
> >
> >\scanrcs $Id: foo.tex,v 1.1 2001/07/11 20:49:46 hahe Exp hahe $
> >
> >\fileversion
> >\bye
> >% end of file foo.tex
> >
> >E. g. this prints `1.1', the current version. 
> >
> >Should be transferable also to ConTeXt, but don't have experience with
> >it.
> 
> Where is this line put? At the top of a file? In a separate file? In
> principle reading such a line could be automated [i.e. hooked into \starttext]
> 
> Hans

------------------------------------------------------------------------
Dr.-Ing. Hartmut Henkel
In den Auwiesen 6, D-68723 Oftersheim, Germany
E-Mail: hartmut_henkel@gmx.de
http://www.circuitwizard.de
------------------------------------------------------------------------


  reply	other threads:[~2001-07-12 19:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-10 15:30 Versionnumbers Hokojoku, Bert
2001-07-10 15:55 ` Versionnumbers Frans Goddijn
2001-07-11 21:03   ` Versionnumbers Hartmut Henkel
2001-07-12  7:17     ` Versionnumbers Hans Hagen
2001-07-12 19:00       ` Hartmut Henkel [this message]
2001-07-10 16:34 ` Versionnumbers Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.21.0107122026270.985-100000@hahepc1.hahe \
    --to=hartmut_henkel@gmx.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).