[thelist] getting 'changed by' from cvs

SBeam sbeam at syxyz.net
Wed Jul 9 17:51:50 CDT 2003


> however, all the content is kept in cvs, so it's certainly being marked
> with a last modification time and username of the committer in the cvs
> log.  is there any nifty perl-y way to get this info out of cvs without
> the overhead of calling cvs for each page request?  maybe, every time
> someone checks something in, a separate script edits the line in the
> file (say by writing a script that does that, then does the cvs
> commit)? or something more clever?
>
> how do others solve this problem in mostly automatic way?
>

No need to torture yourself with all that. CVS does keyword expansion during 
checkins for just this kind of thing:
http://www.loria.fr/~molli/cvs/doc/cvs_12.html#SEC92

just put
'this page changed by $Author$ at $Date$'
in each file.

of course this will add the Unix-y username of the user, not their real full 
name. If you want it to say 'Thurston P. Howell III' instead of 'thowell' 
then look at writing a script to add to cvswrappers:
http://www.loria.fr/~molli/cvs/doc/cvs_18.html#SEC159

your script could do 
while (<>) {
  s/page changed by (\w+) at/$user_full_names{$1}/
}

enjoy and good luck.


More information about the thelist mailing list