Discussion:
how to show list of tags
J.V.
2011-08-07 21:01:13 UTC
Permalink
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.

I have googled and googled, read many documents and no where can I find
a single command that will show me a list of cvs tags.

Ideally I would also like to simply show branch tags, but also need ALL
tags.

If anyone can help, that would be great. I do not have the time to
write a perl script to do this.

Regards,

J.V.
Jim Hyslop
2011-08-05 14:20:59 UTC
Permalink
Post by J.V.
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.
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`.

- --
Jim Hyslop
Dreampossible: Better software. Simply. http://www.dreampossible.ca
Consulting * Mentoring * Training in
C/C++ * OOD * SW Development & Practices * Version Management
Arthur Barrett
2011-08-07 22:45:14 UTC
Permalink
J.V. & Jim,
Post by J.V.
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.
Post by J.V.
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
KM
2011-08-08 15:40:38 UTC
Permalink
 
Sorry about this ...but another newbie question... which I still find confusing.... with the example below, listing all the tags, shouldn't that include branches?
 
i ran the command and don't see any branch for our current/newest version, but the developers are committing to it.
 
Is there a way to list all the branches? Thx and sorry
KM

From: Arthur Barrett <***@march-hare.com>
To: J.V. <***@gmail.com>; info-***@nongnu.org
Sent: Sunday, August 7, 2011 6:45 PM
Subject: RE: how to show list of tags

J.V. & Jim,
Post by J.V.
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.
Post by J.V.
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
Cumps, Erik
2011-08-11 11:45:07 UTC
Permalink
Please find attached the 'lstag' perl script which should do what you
require:



Usage: /home/buildtree/bin/lstag [-d cvsroot] command [module]



Where: -d cvsroot Specifies cvs root, overrides 'CVSROOT' environment

variable and 'CVS/Root' file.



command -l shows list of all known tags

tag shows list of files with this tag



module Specifies module, overrides 'CVS/Repository' file.



This command can be run from within a CVS sandbox. In this case both the

CVSROOT and CVS module can be overridden by the command line options.
Note:

in this case the CVSROOT environment variable won't override the sandbox
info.



If not run from within a sandbox the CVSROOT and CVS module MUST be set
on

the command line or, in the case of CSVROOT, via the environment.
lstag -l
/home/buildtree/bin/lstag - CVS tag and file lister version 1.11



List of all known tags:



BUILDROOT_2011_05

MY_BUILDROOT_2011_05
lstag MY_BUILDROOT_2011_05
/home/buildtree/bin/lstag - CVS tag and file lister version 1.11



Files with tag "MY_BUILDROOT_2011_05":



Up-to-date 1.1.2 buildroot/boot/syslinux/Config.in

Up-to-date 1.1.2
buildroot/boot/syslinux/syslinux-3.85-makefile.patch

Up-to-date 1.1.2 buildroot/boot/syslinux/syslinux.mk



Regards,

Erik Cumps



-----Original Message-----
From: info-cvs-bounces+erik.cumps=kla-***@nongnu.org
[mailto:info-cvs-bounces+erik.cumps=kla-***@nongnu.org] On Behalf
Of J.V.
Sent: Sunday, August 07, 2011 11:01 PM
To: info-***@nongnu.org
Subject: how to show list of tags



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.



I have googled and googled, read many documents and no where can I find

a single command that will show me a list of cvs tags.



Ideally I would also like to simply show branch tags, but also need ALL

tags.



If anyone can help, that would be great. I do not have the time to

write a perl script to do this.



Regards,



J.V.

Loading...