Get last message or diff of the very last CVS commit
Asked Answered
L

3

8

I am wondering how to get the last changes in a CVS module easily.

Larhondalari answered 7/10, 2009 at 11:20 Comment(1)
What specifically are you looking for? Do you want the CVS log output for the last change, or the changes themselves, or something else?Petrapetracca
H
12

I think perhaps you could use the history command. Try something like:

cvs history -c -D 2012-04-01 -a

The above example shows all commits since the date specified (specified so the list is limited in length...).

-c means commits, -a means all users.

Commits with the same timestamp and user are then obviously from the same commit. You can then proceed to read the log message of that commit with

cvs log -r <version> <file>

Just select one of the files from the specific commit. You find the version of that file in the history output as well. Finally, to see the diff I would use

cvs diff -D "<date 1>" -D "<date 2>"

Here, "date 1" and "date 2" should be a timestamp just before and just after the commit. Note that (as far as I am aware), this does not seem to work if you are working on a branch (??). That would be the topic for another question I suppose.

Harriott answered 7/5, 2012 at 8:57 Comment(0)
L
0

cvs log will return all of them. Since you can't say "the last N revisions" (here, I can't even say cvs log HEAD), there are two options:

  1. Use head -N the get the N topmost lines (Unix or Cygwin only)

  2. Use a date and cvs log -d DATE

Latimore answered 7/10, 2009 at 11:50 Comment(0)
E
0

Since the CVS implementation versions each file individually, I suppose you'd have to through each file and compare the commit timestamps to determine which one is the latest. Combine this with the fact that CVS does not support the concept of a commit set, so you can get a bunch of files with equal commit timestamp. So which one is the latest? Or maybe you could create a commit hook that writes to a log file and use that to determine the latest commit.

As you probably figured out, neither of these is a particularly giving path to choose. I strongly suggest that at the module-level you always compare against tags. Establish a software process that includes tagging the module when an important enough improvement is made (e.g. daily build, deployment to test environment, etc..) and then use the created tag as the comparison baseline.

You can accomplish diffing the latest changes against a tag by using

  • cvs rdiff command without a working copy, or
  • cvs diff command at the top-level of a working copy

See the CVS documentation for complete reference.

Enzootic answered 13/10, 2009 at 13:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.