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

北城以北 提交于 2020-01-01 09:28:33

问题


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!


回答1:


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



来源:https://stackoverflow.com/questions/5406697/cvs-how-to-get-the-date-when-a-tag-is-created

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!