info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: how to show list of tags


From: Arthur Barrett
Subject: RE: how to show list of tags
Date: Mon, 8 Aug 2011 09:45:14 +1100

J.V. & Jim,

> I want to print a list of all cvs tags (one entry per line) 
> in our repo 
> from the command line using a single tag and then pass that to grep 
> looking for a pattern.


This is not an uncommon request, but getting the answer you want may be
more difficult than it first appears.

Please always include the version number of your CVS client and CVS
Server, and if possible also the operating system of both the server and
client.  Different features are available on different versions.

In some versions of CVS there is a file maintained in the CVSROOT
directory called 'val_tags'.  The purpose of this is to receive the name
of a tag when it is created - so *in theory* val_tags contains a list of
all the tags in your repository.  

In CVSNT (yes it's GPL/runs on linux) version 2.5 and higher there is a
failsafe audit database (eg: Sqlite, MySQL or Oracle).  The table TagLog
will contain a list of all tags.

> Can I assume you meant "using a single command"?
> 
> `cvs history -xT` can get you close, but it will only report tags that
> were created using `cvs rtag`, not `cvs tag`.

The 'cvs history' command gets its informaiton from the file
CVSROOT/history.  The problem with both this file and CVSROOT/val_tags
is identical: they are not failsafe.  Ie: if the server process is
unable to write to the file, then the entry is discarded.  The write may
fail for valid reasons (eg: history/val_tags is turned 'off'), or it may
fail for invalid reasons (eg: another process is currently writing to
the file).   So under no circumstances can 'cvs history' command be used
to gather a definitive list of anything.  CVSNT had to undergo a major
rewrite to make this 'failsafe' ie: make the command on the client fail
if the history/val_tags/audit can't be written.  The CVSNT project also
found that writing this sort of information to a file (like
history/val_tags) was a bit useless, so it's now written to a database
(of the users choice) instead.

So depending on the version of CVS server you are using (1.10, 1.11,
2.0, 2.5, 2.8) you have a few different choices.

Regards,


Arthur Barrett
Product Manager CVSNT
March Hare Software



reply via email to

[Prev in Thread] Current Thread [Next in Thread]