Using CVSSpam with Subversion

When switching from one application to another, like migrating from CVS to SVN, users tend to take the switch more lightly if they find the new application looking familiar.I recently had the task to set up an SVN environment for one of our projects and among the requirements was „SVNSpam“.
The standard SVN mail notification mechanism just sends plain computer-readable diffs in ascii, no fancy HTML diffs with color-markup.
After some searching, I found that apparently the tool regarded as SVNSpam is really CVSSpam with some new scripts. Alas, the documentation of CVSSpam does not mention SVN at all. After mailing the author, he told me that the SVN scripts are unmaintained user contributions of unknown status.

A little digging into ruby code and comparing the scripts and paths with the default SVN mailing facility brought up the solution:

copy all .rb and .sh files from cvsspam to /srv/svn/{project}/hooks and create an executable shellscript there named „post-commit“:

#!/bin/sh
/srv/svn/{project}/hooks/svn_post_commit_hook.sh –to receipient@example.com –from sender@example.com $*

For cosmetic purposes I then edited cvsspam.rb to prepend „[SVN Projectname]“ instead of „[CVS Projectname]“. Now SVN sends the familiar fancy-colored diffs after a commit. The CVSSpam author said that an SVN move command is shown as copy & delete, but that does not really matter for now.

The boss is happy and the coworkers have their familiar view :-)

Für neue Blogupdates anmelden:


7 Gedanken zu “Using CVSSpam with Subversion

  1. Hey Martin/Folks,

    I didnot receive any files…could you please resend them again ?

    ABove steps are not clear.

    Thanks in advance,
    ~Saha

  2. I’m somewhat managing my experiment’s SVN repository, but have never worked with CVS to have any clue how CVSSpam is supposed to work. We’ve had some luck with using CVSSpam, but not with the post-commit script. We’ve gotten it working by using the AddRecipient lines of the CVSspam.conf file. We don’t get the color-coding that I see on the web, but we get diff output, and that’s a start.

    I’d like to make it obvious WHO is doing the commit. What is the best way to do it? Would I be able to use $USER in the –from option of the post-commit script (if it worked)? What is the function of the $* in your example? Should that go at the end of every line, or the end of the document?

    This is the most documentation I have found anywhere!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.