<div id="user_002ddefined-logging"></div>
<div class="header">
<p>
Next: [[cvs: Annotate command#Annotate command|annotate]], Previous: [[cvs: The history database#The history database|history database]], Up: [[cvs: History browsing#History browsing|History browsing]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>

----

<div id="User_002ddefined-logging"></div>
=== User-defined logging ===

You can customize <small>CVS</small> to log various kinds of
actions, in whatever manner you choose.  These
mechanisms operate by executing a script at various
times.  The script might append a message to a file
listing the information and the programmer who created
it, or send mail to a group of developers, or, perhaps,
post a message to a particular newsgroup.  To log
commits, use the &lsquo;<tt>loginfo</tt>&rsquo; file (see [[cvs: Loginfo#Loginfo|loginfo]]).
To log commits, checkouts, exports, and tags,
respectively, you can also use the &lsquo;<code>-i</code>&rsquo;,
&lsquo;<code>-o</code>&rsquo;, &lsquo;<code>-e</code>&rsquo;, and &lsquo;<code>-t</code>&rsquo; options in the
modules file.  For a more flexible way of giving
notifications to various users, which requires less in
the way of keeping centralized scripts up to date, use
the <code>cvs watch add</code> command (see [[cvs: Telling CVS to notify you#Telling CVS to notify you|Getting Notified]]); this command is useful even if you are not
using <code>cvs watch on</code>.

<div id="index-taginfo"></div>
<div id="index-Exit-status_002c-of-taginfo"></div>
The &lsquo;<tt>taginfo</tt>&rsquo; file defines programs to execute
when someone executes a <code>tag</code> or <code>rtag</code>
command.  The &lsquo;<tt>taginfo</tt>&rsquo; file has the standard form
for administrative files (see [[cvs: Reference manual for Administrative files#Reference manual for Administrative files|Administrative files]]), where each line is a regular expression
followed by a command to execute.  The arguments passed
to the command are, in order, the <var>tagname</var>,
<var>operation</var> (<code>add</code> for <code>tag</code>,
<code>mov</code> for <code>tag -F</code>, and <code>del</code> for
<code>tag -d</code>), <var>repository</var>, and any remaining are
pairs of <var>filename</var> <var>revision</var>.  A non-zero
exit of the filter program will cause the tag to be
aborted.

Here is an example of using taginfo to log tag and rtag
commands.  In the taginfo file put:

<div class="example" style="margin-left: 3.2em">
 ALL /usr/local/cvsroot/CVSROOT/loggit
</div>

Where &lsquo;<tt>/usr/local/cvsroot/CVSROOT/loggit</tt>&rsquo; contains the
following script:

<div class="example" style="margin-left: 3.2em">
 #!/bin/sh
 echo &quot;$@&quot; &gt;&gt;/home/kingdon/cvsroot/CVSROOT/taglog
</div>


----

<div class="header">
<p>
Next: [[cvs: Annotate command#Annotate command|annotate]], Previous: [[cvs: The history database#The history database|history database]], Up: [[cvs: History browsing#History browsing|History browsing]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
