1<div id="History-browsing"></div>
2<div class="header">
3<p>
4Next: [[cvs: Handling binary files#Handling binary files|Binary files]], Previous: [[cvs: Adding, removing, and renaming files and directories#Adding, removing, and renaming files and directories|Adding and removing]], Up: [[cvs#Top|Top]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
5</div>
6<div id="History-browsing-1"></div>
7== History browsing ==
8<div id="index-History-browsing"></div>
9<div id="index-Traceability"></div>
10<div id="index-Isolation"></div>
11
12
13Once you have used <small>CVS</small> to store a version control
14history&mdash;what files have changed when, how, and by
15whom, there are a variety of mechanisms for looking
16through the history.
17
18<div class="menu-preformatted" style="font-family: serif">
19 [[#Log messages|&bull; log messages]]::                Log messages
20 [[#The history database|&bull; history database]]::            The history database
21 [[#User-defined logging|&bull; user-defined logging]]::        User-defined logging
22 [[#Annotate command|&bull; annotate]]::                    What revision modified each line of a file?
23</div>
24
25
26----
27
28<div id="log-messages"></div>
29<div class="header">
30<p>
31Next: [[#The history database|history database]], Up: [[#History browsing|History browsing]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
32</div>
33<div id="Log-messages"></div>
34=== Log messages ===
35
36Whenever you commit a file you specify a log message.
37
38To look through the log messages which have been
39specified for every revision which has been committed,
40use the <code>cvs log</code> command (see [[cvs: Guide to CVS commands#log&mdash;Print out log information for files|log]]).
41
42
43----
44
45<div id="history-database"></div>
46<div class="header">
47<p>
48Next: [[#User-defined logging|user-defined logging]], Previous: [[#Log messages|log messages]], Up: [[#History browsing|History browsing]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
49</div>
50<div id="The-history-database"></div>
51=== The history database ===
52
53You can use the history file (see [[cvs: Reference manual for Administrative files#The history file|history file]]) to
54log various <small>CVS</small> actions.  To retrieve the
55information from the history file, use the <code>cvs
56history</code> command (see [[cvs: Guide to CVS commands#history&mdash;Show status of files and users|history]]).
57
58Note: you can control what is logged to this file by using the
59&lsquo;<code>LogHistory</code>&rsquo; keyword in the &lsquo;<tt>CVSROOT/config</tt>&rsquo; file
60(see [[cvs: Reference manual for Administrative files#The CVSROOT/config configuration file|config]]).
61
62
63
64----
65
66<div id="user_002ddefined-logging"></div>
67<div class="header">
68<p>
69Next: [[#Annotate command|annotate]], Previous: [[#The history database|history database]], Up: [[#History browsing|History browsing]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
70</div>
71<div id="User_002ddefined-logging"></div>
72=== User-defined logging ===
73
74You can customize <small>CVS</small> to log various kinds of
75actions, in whatever manner you choose.  These
76mechanisms operate by executing a script at various
77times.  The script might append a message to a file
78listing the information and the programmer who created
79it, or send mail to a group of developers, or, perhaps,
80post a message to a particular newsgroup.  To log
81commits, use the &lsquo;<tt>loginfo</tt>&rsquo; file (see [[cvs: Reference manual for Administrative files#Loginfo|loginfo]]).
82To log commits, checkouts, exports, and tags,
83respectively, you can also use the &lsquo;<code>-i</code>&rsquo;,
84&lsquo;<code>-o</code>&rsquo;, &lsquo;<code>-e</code>&rsquo;, and &lsquo;<code>-t</code>&rsquo; options in the
85modules file.  For a more flexible way of giving
86notifications to various users, which requires less in
87the way of keeping centralized scripts up to date, use
88the <code>cvs watch add</code> command (see [[cvs: Multiple developers#Telling CVS to notify you|Getting Notified]]); this command is useful even if you are not
89using <code>cvs watch on</code>.
90
91<div id="index-taginfo"></div>
92<div id="index-Exit-status_002c-of-taginfo"></div>
93The &lsquo;<tt>taginfo</tt>&rsquo; file defines programs to execute
94when someone executes a <code>tag</code> or <code>rtag</code>
95command.  The &lsquo;<tt>taginfo</tt>&rsquo; file has the standard form
96for administrative files (see [[cvs: Reference manual for Administrative files#Reference manual for Administrative files|Administrative files]]), where each line is a regular expression
97followed by a command to execute.  The arguments passed
98to the command are, in order, the <var>tagname</var>,
99<var>operation</var> (<code>add</code> for <code>tag</code>,
100<code>mov</code> for <code>tag -F</code>, and <code>del</code> for
101<code>tag -d</code>), <var>repository</var>, and any remaining are
102pairs of <var>filename</var> <var>revision</var>.  A non-zero
103exit of the filter program will cause the tag to be
104aborted.
105
106Here is an example of using taginfo to log tag and rtag
107commands.  In the taginfo file put:
108
109<div class="example" style="margin-left: 3.2em">
110 ALL /usr/local/cvsroot/CVSROOT/loggit
111</div>
112
113Where &lsquo;<tt>/usr/local/cvsroot/CVSROOT/loggit</tt>&rsquo; contains the
114following script:
115
116<div class="example" style="margin-left: 3.2em">
117 #!/bin/sh
118 echo &quot;$@&quot; &gt;&gt;/home/kingdon/cvsroot/CVSROOT/taglog
119</div>
120
121
122----
123
124<div id="annotate"></div>
125<div class="header">
126<p>
127Previous: [[#User-defined logging|user-defined logging]], Up: [[#History browsing|History browsing]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
128</div>
129<div id="Annotate-command"></div>
130=== Annotate command ===
131<div id="index-annotate-_0028subcommand_0029"></div>
132
133;<div id="index-cvs-annotate"></div>Command<nowiki>:</nowiki> <strong>cvs annotate</strong><em> <nowiki>[</nowiki><code>-FflR</code><nowiki>]</nowiki> <nowiki>[</nowiki><code>-r rev</code>|<code>-D date</code><nowiki>]</nowiki> files &hellip;</em>
134
135: For each file in <var>files</var>, print the head revision of the trunk, together with information on the last modification for each line.  For example:
136
137<div class="example" style="margin-left: 3.2em">
138 $ cvs annotate ssfile
139 Annotations for ssfile
140 ***************
141 1.1          (mary     27-Mar-96): ssfile line 1
142 1.2          (joe      28-Mar-96): ssfile line 2
143</div>
144
145: The file &lsquo;<tt>ssfile</tt>&rsquo; currently contains two lines. The <code>ssfile line 1</code> line was checked in by <code>mary</code> on March 27.  Then, on March 28, <code>joe</code> added a line <code>ssfile line 2</code>, without modifying the <code>ssfile line 1</code> line.  This report doesn&rsquo;t tell you anything about lines which have been deleted or replaced; you need to use <code>cvs diff</code> for that (see [[cvs: Guide to CVS commands#diff&mdash;Show differences between revisions|diff]]).
146
147
148The options to <code>cvs annotate</code> are listed in
149[[cvs: Quick reference to CVS commands#Quick reference to CVS commands|Invoking CVS]], and can be used to select the files
150and revisions to annotate.  The options are described
151in more detail there and in [[cvs: Guide to CVS commands#Common command options|Common options]].
152
153
154
155----
156
157<div class="header">
158<p>
159Previous: [[#User-defined logging|user-defined logging]], Up: [[#History browsing|History browsing]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
160</div>
161This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
162