I'll assume that by "comment", you mean the log message provided with cvs commit
.
Given just a *,v
file, you can use the rlog
command (part of rcs, not part of cvs) to get a log that will show all the commit messages.
But ordinarily it should be part of a CVS repository; in that case, cvs log
will do the same thing.
Both rlog
and cvs log
produce very similar plain-text output that should be reasonably easy to parse.
That's about all I can come up with based on the information you've given us. Provide a more detailed question, and we can probably give you a more detailed answer.
UPDATE :
If by "comments" you mean text in the files themselves rather than commit messages, you can extract individual versions of the file using a command like this:
cvs update -p -r1.23 filename
The -p
option tells cvs update
to print the contents of the file to stdout.
Shameless self-promotion: My own get-versions tool lets you grab multiple versions of a file in a single command (it currently works with RCS, CVS, and Git).
Extracting a particular comment and storing it in a variable will require more work and, as I said, a more detailed question.