One of the cool things about CVS that I've found incredibly useful at work is getting commit (check-in) notifications via e-mail. I've long wished I knew how to set that up for some of my personal repositories. Specifically, I had my book repository in mind. Since there are two of us collaborating, it'll be easier to know when the other has done something.
It turns out that it's really not rocket surgery at all. In the CVSROOT directory is a file called loginfo. By adding a line like this to it:
^book /usr/bin/Mail -s [book cvs]: %s authors@highperformancemysql.com
We're able to get the e-mail upon commit. More information is here in the CVS manual.
Posted by jzawodn at November 08, 2003 06:27 PM
'rocket surgery' - I like it!
But yeah, CVS mails are the business -- perfect for code reviewing. Does that stanza provide diffs of the changes in the mail?
No diffs, just the commit message and file(s) affected. There's a way to diffs, but for this I'm not terribly interested in 'em. For code they're great, though.
We have CVS commits both going to email to a bunch of people, plus to a changelog journal:
http://changelog.livejournal.com/
And that's the format of our emails too, with links to review the patches.
We also have support for subjects (commit message begins with [subject]) and private commits (for security stuff) that only show up to core developers on the journal URL above.
This is in no way praise for CVS, though. It was ugly getting it all integrated. And we still have permission hell all the time.
I'm curious to try arch or subversion, but I haven't gotten around to trying either.
Derek's actually *doing something* on the book? :-)
activitymail is my favorite of the CVS email scripts
but really, i've given up using email notification of commits in favor of cvs2rss
You can only partly do diffs -- there's a problem when you have spaces in either filename or CVS module name -- you can deal with space in one, but not both, do to a lack of separators and/or whitespace escaping in the expansion of %{sVv}. It's particularly problematic when you have multiple files checked in simultaneously. perl script to at least handle some of this stuff is here -- adapt to taste.
You might want to have a look at how cvs.php.net does the job. (http://cvs.php.net/cvs.php/CVSROOT)
Er, can I be a total ignoramus and ask what, exactly, is a "commit (check-in) notification"? Pah-wease? with sugar on top?
ooh, cvsspam is cool.. I'll have to dump it on our cvs box at work.. assuming I don't blow it up in the process, I don't have good track record with it.
I must be dense, but what is cool about HTML-formatted commit messages? Just stick a nice diff -u like we do at cvs.php.net and you are not going to piss off the folks doing the real work.
Everybody is writing for O'reilly nowadays..
I'm going to have to re-cook the CVS repository on our server so I can try out CVSSpam..its been broken for awhile now :)
Thanks Jeremy. Your post (after all these years :-)) helped me address a slightly similar requirement.
Thanks for this - I've got it going, and have added diffs and so on to it. Fantastic.
Jeremy,
Thanks for your post, I am getting a 404 on link provided 'in the CVS manual' www.cvshome.org/docs/manual/current/cvs_18.html#SEC171
Does it give you the commit description, and the new files committed?
If the commit touches multiple files, does it send an email on each file touched?
or include all the files touched in the commit in one email?
Thanks in advance.