While at LynuxWorks it became clear to me that I needed to understand CVS better. Also there seemed to be many opportunities to develop scripts and processes to make it easier to do day to day operations as well as to better report activity in CVS. These are some of the scripts that I developed.
CVS Report is a Perl script that I developed starting from a Perl script that was already in operation at LynuxWorks. The basic Perl script just reported the difference from a CVS tag to HEAD. The first thing I wanted to accomplish was to allow cvs_report to report the difference between two arbitrary CVS tags - i.e. to answer the question "What changed between tag X and Y?". Also, cvs_report would optionally send email with the report of what changed. Default would be from a CVS taq to HEAD.
If no email addresses are specified then cvs_report would just display the report to stdout. This would be useful in generating build notes describing what defects were fixed since a release tag.
Next I decided that cvs_report should be able to deposit a data file describing what had changed in such a way that a PHP script could produce a web page of what changed. This way interested engineers could visit a web site to see what check in/check out activity has been happening lately.
cvs_report was then modified to maintain a history of data files (named YYYYMMDD), checking to see if today's report was different at all from yesterday's report. Additionally a cronjob was implemented such that only 30 days of history was maintained. The crontab entries needed are:
# Produce CVS Report for xxxx 20 04 * * * /int/bin/cvs_report -dir /web/cvsr/xxxx -m xxxx -cvs :pserver:anoncvs@<server>:/cvs/<repository>
And the crontab entry to clean up files over 30 days old is:
# Clean up reports over 30 days
00 06 * * * cd /web/cvsr && find . -name "????????" -mtime +30 -exec rm -f {} \;
Now, instead of receiving a daily email saying what has been changed (which was often simply ignored as noise) a manager or engineer could go to a web site to research what CVS activity was happening with a CVS respository by CVS module then by date.
Once the data files were deposited into the web server's DocumentRoot PHP could take over to display an attractive web page report of the defects fixed based on the datafile. Additionally the web pages were made such that a visitor could see the full report of what has changed since the prior tag or just what changed since the last report.
A PHP script was developed to scan the CVS area where data files were deposited and present an index page of report dates available linked to their corresponding report web pages.
cvs_report was still useful and could be used to send email to those who still wanted it as well as be used to generate build notes.
Additionally, cvs_report would create CVS areas and reuse them night after night by using CVS commands to determine check in/check out activity. cvs_report could also be used on different CVS respositories via command line parameters rather than hardcoding.
The source code for cvs_report is available here.
Often the question was asked: "What files were associated with the ECR|CR X?". (At LynuxWorks there were multiple defect tracking systems - one calling defects ECRs and the other calling them just CRs). I developed scripts that would identify and optional update a CVS repository with the file revisions associated with the ECR or the CR.