|[[cvs: Adding, removing, and renaming files and directories#Adding, removing, and renaming files and directories| << ]]|

|[[cvs: Adding, removing, and renaming files and directories#Moving and renaming directories| < ]]|

|[[cvs#Top| Up ]]|

|[[#Log messages| > ]]|

|[[cvs: Handling binary files#Handling binary files| >> ]]|

|[[cvs#Top|Top]]|

|[[cvs: Table of Contents#SEC_Contents|Contents]]|

|[[cvs: Index#Index|Index]]|

|[[cvs: About this Manual#SEC_About| ? ]]|

== History browsing ==

Once you have used CVS to store a version control history—what files have changed when, how, and by whom, there are a variety of mechanisms for looking through the history.

----

|[[#History browsing| << ]]| | |[[#History browsing| < ]]| | |[[#History browsing| Up ]]| | |[[#The history database| > ]]| | |[[cvs: Handling binary files#Handling binary files| >> ]]| |  |  |  |  | |[[cvs#Top|Top]]| | |[[cvs: Table of Contents#SEC_Contents|Contents]]| | |[[cvs: Index#Index|Index]]| | |[[cvs: About this Manual#SEC_About| ? ]]|

=== Log messages ===

Whenever you commit a file you specify a log message.

To look through the log messages which have been specified for every revision which has been committed, use the `cvs log` command (see section [[cvs: Guide to CVS commands#log—Print out log information for files|log—Print out log information for files]]).

----

|[[#History browsing| << ]]| | |[[#Log messages| < ]]| | |[[#History browsing| Up ]]| | |[[#User-defined logging| > ]]| | |[[cvs: Handling binary files#Handling binary files| >> ]]| |  |  |  |  | |[[cvs#Top|Top]]| | |[[cvs: Table of Contents#SEC_Contents|Contents]]| | |[[cvs: Index#Index|Index]]| | |[[cvs: About this Manual#SEC_About| ? ]]|

=== The history database ===

You can use the history file (see section [[cvs: Reference manual for Administrative files#The history file|The history file]]) to log various CVS actions. To retrieve the information from the history file, use the `cvs history` command (see section [[cvs: Guide to CVS commands#history—Show status of files and users|history—Show status of files and users]]).

Note: you can control what is logged to this file by using the ‘`LogHistory`’ keyword in the ‘`CVSROOT/config`’ file (see section [[cvs: Reference manual for Administrative files#The CVSROOT/config configuration file|The CVSROOT/config configuration file]]).

----

|[[#History browsing| << ]]| | |[[#The history database| < ]]| | |[[#History browsing| Up ]]| | |[[#Annotate command| > ]]| | |[[cvs: Handling binary files#Handling binary files| >> ]]| |  |  |  |  | |[[cvs#Top|Top]]| | |[[cvs: Table of Contents#SEC_Contents|Contents]]| | |[[cvs: Index#Index|Index]]| | |[[cvs: About this Manual#SEC_About| ? ]]|

=== User-defined logging ===

You can customize CVS 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 ‘`loginfo`’ file (see section [[cvs: Reference manual for Administrative files#Loginfo|Loginfo]]). To log commits, checkouts, exports, and tags, respectively, you can also use the ‘`-i`’, ‘`-o`’, ‘`-e`’, and ‘`-t`’ 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 `cvs watch add` command (see section [[cvs: Multiple developers#Telling CVS to notify you|Telling CVS to notify you]]); this command is useful even if you are not using `cvs watch on`.

The ‘`taginfo`’ file defines programs to execute when someone executes a `tag` or `rtag` command. The ‘`taginfo`’ file has the standard form for administrative files (see section [[cvs: Reference manual for Administrative files#Reference manual for Administrative files|Reference manual for 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 tagname, operation (`add` for `tag`, `mov` for `tag -F`, and `del` for `tag -d`), repository, and any remaining are pairs of filename revision. 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:

ALL /usr/local/cvsroot/CVSROOT/loggit

Where ‘`/usr/local/cvsroot/CVSROOT/loggit`’ contains the following script:

#!/bin/sh echo "$@" >>/home/kingdon/cvsroot/CVSROOT/taglog

----

|[[#History browsing| << ]]| | |[[#User-defined logging| < ]]| | |[[#History browsing| Up ]]| | |[[cvs: Handling binary files#Handling binary files| > ]]| | |[[cvs: Handling binary files#Handling binary files| >> ]]| |  |  |  |  | |[[cvs#Top|Top]]| | |[[cvs: Table of Contents#SEC_Contents|Contents]]| | |[[cvs: Index#Index|Index]]| | |[[cvs: About this Manual#SEC_About| ? ]]|

=== Annotate command ===

;
Command<nowiki>:</nowiki> cvs annotate <nowiki>[</nowiki>`-FflR`<nowiki>]</nowiki> <nowiki>[</nowiki>`-r rev`|`-D date`<nowiki>]</nowiki> files …

: For each file in files, print the head revision of the trunk, together with information on the last modification for each line. For example:

$ cvs annotate ssfile Annotations for ssfile *************** 1.1 (mary 27-Mar-96): ssfile line 1 1.2 (joe 28-Mar-96): ssfile line 2

: The file ‘`ssfile`’ currently contains two lines. The `ssfile line 1` line was checked in by `mary` on March 27. Then, on March 28, `joe` added a line `ssfile line 2`, without modifying the `ssfile line 1` line. This report doesn’t tell you anything about lines which have been deleted or replaced; you need to use `cvs diff` for that (see section [[cvs: Guide to CVS commands#diff—Show differences between revisions|diff—Show differences between revisions]]).

The options to `cvs annotate` are listed in [[cvs: Quick reference to CVS commands#Quick reference to CVS commands|Quick reference to CVS commands]], and can be used to select the files and revisions to annotate. The options are described in more detail there and in [[cvs: Guide to CVS commands#Common command options|Common command options]].

----

|[[#History browsing| << ]]| | |[[cvs: Handling binary files#Handling binary files| >> ]]| |  |  |  |  |  | |[[cvs#Top|Top]]| | |[[cvs: Table of Contents#SEC_Contents|Contents]]| | |[[cvs: Index#Index|Index]]| | |[[cvs: About this Manual#SEC_About| ? ]]|

This document was generated on a sunny day using [http://www.nongnu.org/texi2html/ texi2html].