Log Command
The log command displays log information for the file. All the changes made to a file since it was created or within a particular time span are displayed. To display the log of the file, test.txt, the command is given below along with the output:$ cvs log test.txt RCS file: /home/perlproject/test.txt,v Working file: test.txt head: 1.2 branch: locks: strict access list: symbolic names: start: 1.1.1.1 pp: 1.1.1 keyword substitution: kv total revisions: 3; selected revisions: 3 description: ---------------------------- revision 1.2 date: 2009-03-01 21:56:37 -0500; author: abhishek; state: Exp; lines: +1 -0; commitid: 06lkV5xhtSH6apEt; iooooo ---------------------------- revision 1.1 date: 2009-02-27 22:23:57 -0500; author: abhishek; state: Exp; commitid: yLb56jfsWXfvn9Et; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2009-02-27 22:23:57 -0500; author: abhishek; state: Exp; lines: +0 -0; commitid: yLb56jfsWXfvn9Et; ===================================================== $Log messages are specified using the editor or the –m command option. This command displays all the revisions made to a file, including revision number, author, Greenwich Mean Time (GMT) timestamp, number of lines changed, and date on which the changes were made. Every log message associated with a revision is also displayed.
Have a look at the following command:
$ cvs logIf we use this command, the log of all the files and sub-directories within the current directory will be displayed.
Options of the log command
1) -l
This option will show the log of all the files within the current directory only and not within the sub-directories.
2) -N
This option tells the log command to skip the tags of the file. This is used when a file has many tags and you don't need them to be displayed.
3) -b
This option lists only the revisions on the default branch.
4) -h
This option enables the log command to display only the header of the file. Log entries need not be printed.
5) -R
This option displays only the name of the RCS file. Suppose, there is a file named, test.txt. The output of the -R option with the log command will be:
$ cvs log -R test.txt /home/perlproject/test.txt,v $Suppose, you need the log of the entire directory, the names of all the files will be listed, as shown below:
$ cvs log -R cvs log: Logging . /home/perlproject/test.txt,v /home/perlproject/try,v $6) -t
This option displays the header and the descriptive text. Let's use this option for the same file used above.
cvs log -t test.txt RCS file: /home/perlproject/test.txt,v Working file: test.txt head: 1.4 branch: locks: strict access list: symbolic names: start: 1.1.1.1 pp: 1.1.1 keyword substitution: kv total revisions: 5 description:Test file $7) -S
This option tells the log command to not to print name or header if no revisions are selected.
8) -r rev
This option gives a comma-separated list of revisions, rev to print. The various ways to specify rev are as follows:
rev1:rev2 - Between rev1 and rev2, including rev1 and rev2.
rev1::rev2 - Between rev1 and rev2, excluding rev1.
rev: - rev and following revisions on the same branch.
rev:: - After rev on the same branch.
:rev - rev and previous revisions on the same branch.
::rev - Before rev on the same branch.
rev - Just rev.
branch - All revisions on the branch, branch.
branch. - The last revision on the branch, branch.
9) -d date
A semicolon-separated list of dates can be specified to display the log within the specified dates. 10) -D date
This option is used to display the log of the file for latest before date.
11) -s state
This option only lists the revisions having the states as state.
12) -w login
This option tells the log command to display the log of only those revisions having the login as login.
