Previous section   Next section

5.5 Displaying Recent Changes

The cvs annotate command displays the most recent change for each line of a file in the repository. This is very helpful when you need to know which change broke the compilation or who rewrote a key paragraph in the documentation incorrectly. This command works off the repository copy, not the sandbox copy, so it does not show any changes in the sandbox that were not committed.

For each line, cvs annotate shows the revision number for the last change, the user, the date, and the contents of the line. This is a quick way of discovering who made which change. Example 5-17 shows some of the annotations for the wizzard.h file.

Example 5-17. Using cvs annotate
bash-2.05a$ cvs annotate src/wizzard.h
Annotations for src/wizzard.h
***************
1.6     (doppel   15-Sep-02): #include "config.h"   /* using autoconf */
1.6     (doppel   15-Sep-02): #include "options.h"  /* manual options that can't 
1.1     (jenn     11-Sep-02): 
1.2     (jenn     13-Sep-02): #define TRUE 1
1.2     (jenn     13-Sep-02): #define FALSE 0

cvs annotate has the following syntax:

cvs [cvs-options] annotate [command-options] [filenames]

If you don't give a filename, cvs annotate attempts to run annotate on all the files in the current sandbox. The filenames can be directories or modules.

annotate doesn't work correctly on binary files. CVS tries to display them as text files, which can trigger the bell character and mess with your terminal window.

Use the -F option to run cvs annotate on binary files. You can select which revision to display with -D date and -r revision (or tag), and you can use the -f option to force CVS to use the most recent revision on the trunk if no revision matches the specified date, revision, or tag. cvs annotate uses the usual -l and -R options to control local and recursive operation, respectively.


  Previous section   Next section
Top