CVSspam lookalike for SVN

So, when I was using CVS as my versioning system, there was a nice little program that would automagically send pretty colored diff emails to a mailing list when commits were made. Well now I've decided it would be a good thing to move to SVN - so I installed it, got it set up and working...

And of course I missed my stupid little emails. So I decided to see if I could find a subversion version. Now, my requirements were a bit strict because I wanted pretty colored email diffs - not just plain text ones - after all I'm lazy and like color. So after a few google searches I decided on SVN::Notify I'm not really that into perl stuff - makes my head hurt - but after all, it's easy to install stuff and perl is on every linux system I've ever run across.

So I log into the server and install the sucker - since I'm an idiot and have never done this before it requires some searching until I find the right faq

so after

perl -MCPAN -e shell

and some errors until I figure out I need Module::Build installed FIRST - I get

install SVN::Notify

to work properly

So the perl module is installed, how nice, time to set up the subversion hook

suprisingly there wasn't much on the net about how to debug problems, most of it was trial and error. I set up a mailing list with mailman (hey, I'm lazy remember?) and then go to my repository into the hooks directory and

cp post-commit.tmpl post-commit

Then I add in the line

svnnotify --repos-path "$1" --revision "$2"
--to [email protected] --handler HTML::ColorDiff

just like the instructions say to...and it doesn't work

dammit - so I restart apache2, after all, that usually manages to fix things - still no joy

Then I read the fine print, make post-commit executable - ok

chmod a+x post-commit

Now I'm getting mails but they're basically blank - a bunch more searching and fine print reading and look - it thinks svnlook is in /usr/bin/local - of course I'm on fedora, stuff is in weirdass places - so I add --svnlook /usr/bin/svnlook and --with-diff to my post-commit (yes I want the diff, dammit)

FINALLY - my pretty working emails are all set up and running again

Although I'm less than impressed with instruction manuals for both subversion hooks and the SVN::Notify module - would have saved me about three million headaches if the instructions had included - make sure the post-commit file is executable (chmod a+x) and if the SVN::Notify had - default for svnlook is /usr/bin/local, make sure to change it with --svnlook

Jeez...what a fun day



Well this really help me get started quick, now just to customize the HTML it generates so that it is readable.

Kudos and Thanks

2006-01-24 2:42 pm

Post a Reply