Next: , Previous: Detecting And Resolving Conflicts, Up: A Day With CVS


Finding Out Who Did What (Browsing Log Messages)

By now, the project has undergone several changes. If you're trying to get an overview of what has happened so far, you don't necessarily want to examine every diff in detail. Browsing the log messages would be ideal, and you can accomplish this with the log command:

     floss$ cvs log
     (pages upon pages of output omitted)

The log output tends to be a bit verbose. Let's look at the log messages for just one file:

     floss$ cvs log hello.c
     RCS file: /usr/local/cvs/myproj/hello.c,v
     Working file: hello.c
     head: 1.4
     branch:
     locks: strict
     access list:
     symbolic names:
             start: 1.1.1.1
             jrandom: 1.1.1
     keyword substitution: kv
     total revisions: 5;     selected revisions: 5
     description:
     --------------
     revision 1.4
     date: 1999/04/20 04:14:37;  author: jrandom;  state: Exp;  lines: +1 -1
     adjusted middle line
     --------------
     revision 1.3
     date: 1999/04/20 02:30:05;  author: qsmith;  state: Exp;  lines: +1 -0
     added new middle line
     --------------
     revision 1.2
     date: 1999/04/19 06:35:15;  author: jrandom;  state: Exp;  lines: +1 -0
     print goodbye too
     --------------
     revision 1.1
     date: 1999/04/18 18:18:22;  author: jrandom;  state: Exp;
     branches:  1.1.1;
     Initial revision
     --------------
     revision 1.1.1.1
     date: 1999/04/18 18:18:22;  author: jrandom;  state: Exp;  lines: +0 -0
     initial import into CVS
     =========================================================================
     floss$

As usual, there's a lot of information at the top that you can just ignore. The good stuff comes after each line of dashes, in a format that is self-explanatory.

When many files are sent in the same commit, they all share the same log message; a fact that can be useful in tracing changes. For example, remember back when we committed fish.c and random.c simultaneously? It was done like this:

     floss$ cvs commit -m "filled out C code"
     Checking in a-subdir/subsubdir/fish.c;
     /usr/local/cvs/myproj/a-subdir/subsubdir/fish.c,v  <-  fish.c
     new revision: 1.2; previous revision: 1.1
     done
     Checking in b-subdir/random.c;
     /usr/local/cvs/myproj/b-subdir/random.c,v  <-  random.c
     new revision: 1.2; previous revision: 1.1
     done
     floss$

The effect of this was to commit both files with the same log message: "Filled out C code." (As it happened, both files started at revision 1.1 and went to 1.2, but that's just a coincidence. If random.c had been at revision 1.29, it would have moved to 1.30 with this commit, and its revision 1.30 would have had the same log message as fish.c's revision 1.2.)

When you run cvs log on them, you'll see the shared message:

     floss$ cvs log a-subdir/subsubdir/fish.c b-subdir/random.c
     
     RCS file: /usr/local/cvs/myproj/a-subdir/subsubdir/fish.c,v
     Working file: a-subdir/subsubdir/fish.c
     head: 1.2
     branch:
     locks: strict
     access list:
     symbolic names:
             start: 1.1.1.1
             jrandom: 1.1.1
     keyword substitution: kv
     total revisions: 3;     selected revisions: 3
     description:
     --------------
     revision 1.2
     date: 1999/04/19 06:35:27;  author: jrandom;  state: Exp;  lines: +8 -1
     filled out C code
     --------------
     revision 1.1
     date: 1999/04/18 18:18:22;  author: jrandom;  state: Exp;
     branches:  1.1.1;
     Initial revision
     --------------
     revision 1.1.1.1
     date: 1999/04/18 18:18:22;  author: jrandom;  state: Exp;  lines: +0 -0
     initial import into CVS
     =========================================================================
     RCS file: /usr/local/cvs/myproj/b-subdir/random.c,v
     Working file: b-subdir/random.c
     head: 1.2
     branch:
     locks: strict
     access list:
     symbolic names:
             start: 1.1.1.1
             jrandom: 1.1.1
     keyword substitution: kv
     total revisions: 3;     selected revisions: 3
     description:
     --------------
     revision 1.2
     date: 1999/04/19 06:35:27;  author: jrandom;  state: Exp;  lines: +8 -1
     filled out C code
     --------------
     revision 1.1
     date: 1999/04/18 18:18:22;  author: jrandom;  state: Exp;
     branches:  1.1.1;
     Initial revision
     --------------
     revision 1.1.1.1
     date: 1999/04/18 18:18:22;  author: jrandom;  state: Exp;  lines: +0 -0
     initial import into CVS
     =========================================================================
     floss$

From this output, you'll know that the two revisions were part of the same commit (the fact that the timestamps on the two revisions are the same, or very close, is further evidence).

Browsing log messages is a good way to get a quick overview of what's been going on in a project or to find out what happened to a specific file at a certain time. There are also free tools available to convert raw cvs log output to more concise and readable formats (such as GNU ChangeLog style); we won't cover those tools in this tour, but they'll be introduced in Third-Party Tools.

Karl Fogel wrote this book. Buy a printed copy via his homepage at red-bean.com

copyright  ©  November 19 2019 sean dreilinger url: https://durak.org/sean/pubs/software/cvsbook/Finding-Out-Who-Did-What-_0028Browsing-Log-Messages_0029.html