Using CVSSpam with Subversion

Avatar von Martin Brotzeller

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 :-)

Avatar von Martin Brotzeller

Kommentare

7 Antworten zu „Using CVSSpam with Subversion“

  1. Hi ,

    Can you please help me in installing SVNSpam scripts ?
    Some install steps and scripts would be of great help

    Thanks,
    ~Saha

    1. You got mail.

      1. Hi Martin,

        Great post. Could you send the files to me also?

        Thanks,
        Kris.

      2. Hi Martin,

        Sorry for not replying in between…I was busy in some other things..:(
        I didnot receive any mail from you…

        Could you please send me the scripts and notes for installation?

        Thanks in Advance,
        ~saha

  2. Thanks for posting this! It’s exactly the problem I’ve been wondering about, and one of the things holding us back from migration.

  3. Hey Martin/Folks,

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

    ABove steps are not clear.

    Thanks in advance,
    ~Saha

  4. 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


Für das Handling unseres Newsletters nutzen wir den Dienst HubSpot. Mehr Informationen, insbesondere auch zu Deinem Widerrufsrecht, kannst Du jederzeit unserer Datenschutzerklärung entnehmen.