CVS: How to get the date when a tag is created?
Asked Answered
V

1

8

We have a CVS repository and we create a tag on the active branch whenever a successful build is done. Is there any way by which I can determine the date when the tag was created? Looking into the history doesn't helps since it only tells the date-time stamps of the file when it was modified.

Thanks!

Virtual answered 23/3, 2011 at 14:23 Comment(1)
See also: #3357266Ectoparasite
H
8

You can easily configure CVS to log all tag-related actions. In the file '$CVSROOT/CVSROOT/taginfo' you can hook up a pre-tag script like this:

ALL $CVSROOT/CVSROOT/do_tag

If this script returns a non-zero exit value, the tag operation will be aborted. This allows for syntax checks on the tag names. You can also use this hook to send emails, whenever a new release has been tagged. To write a history of all tag operations, you need to do something like this in your do_tag file:

#!/bin/sh
TAGHISTORY=~cvs/taghistory.log
echo -n "$(date): user $USER, tag " >> $TAGHISTORY
echo "$*" >> $TAGHISTORY
exit 0

If you have the history function enabled, you can execute the following command:

cvs history -a -T

It will give you some lines like this, giving you date+time, user, module and tagname of each tagging operation:

T 2011-04-02 07:55 +0000 ralph  mylib [testtag:A]

For more information check the cvsbook on history

Haydon answered 1/4, 2011 at 1:49 Comment(1)
+1 for the history -a -T but it seems a little flaky. It doesn't show all the tags, even though I know they exist.Ectoparasite

© 2022 - 2024 — McMap. All rights reserved.