As your project develops, you sometimes need to compare a current revision with an old one, or compare two older revisions with each other. This usually happens when several developers are working on the same file and you need to know which changes were made to a file since you last worked on it.
compares two revisions of a file and displays the differences. It
uses a version of the GNU
diff program internal
to CVS; this code is also used when revisions are merged during
diff command and the similar
are also useful for creating patches to be installed by the GNU
cvs diff has the following syntax:
cvs-options] diff [
You can call
cvs diff with filenames,
directories, or module names. If you don’t give a
filename, the current working directory is the default.
Usually, you call
cvs diff with at least one
-r tag or
-D date command
option. If you invoke it with a single
-D parameter, CVS compares the current copy in
the working directory with the version in the repository. For
example, if you check out revision 1.6 of
Makefile, edit the file, then run
diff -r 1.6 Makefile,
the changes you made to
Makefile since you
checked it out.
If you invoke
cvs diff with two
-D options, CVS compares the two
revisions against each other. The command
cvs diff -r 1.5
-r 1.7 Makefile displays the changes between revisions 1.5
Example 5-14 shows ...