Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

tags

cvs

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!

like image 261
Arpit Avatar asked Mar 23 '11 14:03

Arpit


1 Answers

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

like image 54
Ralph Avatar answered Nov 17 '22 23:11

Ralph