4.4. Automatic e-mail on commit

Often it is very helpful to have a commit mailing list that keeps developers up-to-date on every commit happening to the CVS. Perform these steps:

mkdir ~/src; cd ~/src
cvs co CVSROOT
cd CVSROOT
cvs up
wget \
        http://www.icdevgroup.org/~danb/log_accum.pl \
        http://www.icdevgroup.org/~danb/mailout \
        #done.
chmod u+x log_accum.pl mailout
cvs add log_accum.pl mailout
touch updatelog
cvs add updatelog
cat >>checkoutlist <<EOF
log_accum.pl
mailout
updatelog
EOF
# Fix Permissions for updatelog
cd $CVSROOT/CVSROOT
chmod g+w *
echo 'ALL $CVSROOT/CVSROOT/log_accum.pl %s' >> loginfo
cvs commit -m "Automatic E-mail" checkoutlist loginfo ${FN}

As root, you must setup the "cvs-log" alias to go to the correct e-mail address(es).

echo 'cvs-log: email_one@yahoo.com,email_two@yahoo.com' >> /etc/aliases
newaliases

See Mailserver for CVS updates.

Here is what a sample e-mail looks like:

User:      danb
Date:      2003-01-16 23:40:47 GMT
Modified:  pages    index.html
Log:
Testing...


Revision  Changes    Path
1.10      +1 -8      hoopstore/pages/index.html



rev 1.10, prev_rev 1.9
Index: index.html
===================================================================
RCS file: /home/interch/rep/hoopstore/pages/index.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- index.html  16 Jan 2003 22:47:55 -0000      1.9
+++ index.html  16 Jan 2003 23:40:47 -0000      1.10
@@ -31,7 +31,7 @@
   [control-set]
     [component]none[/component]
   [/control-set]
-
+

   [control reset=1]

@@ -51,10 +51,3 @@
 <!-- END CONTENT -->

 @_LEFTRIGHT_BOTTOM_@
-
-

Now you have a working CVS development system. At this point it may be valuable to learn more about CVS the client tools that you are using.