Ruby Script for SVN commit notification with log message, list of updated files and readable colored SVN Diff


Some days ago I wrote a post about “SVN commit notification” which uses a perl script for sending commit notification with svn diff by mail. In this mail you can find svn diff from the last committed revision. I used to love this mail, soon I realized that it is a bit ugly and difficult to read. Also there were some important information missing. Like the name of user committing the code, the log message etc…

And then I started writing my own ruby script for same purpose but with some addition and modification. Commit notification script is that script, you can download and configure it with your SVN post commit hook as follows.

Add following line at the bottom of your post-commit file:

* Please remember to change the path of you commit-email ruby script.

Now open commit-email ruby file and modify the following section according to your requirement:

You are done with that, now onwards whenever someone commits the code, you’ll get the commit notification mail like:

Commit Email Preview

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts
Ajax based online ruby API documentation
Presented at BarCampDelhi3

Reader Comments

Can you upload or pastie this somewhere else? Your blog isn’t letting me download it - I get a 500 error from your download script.

Hi Brian,

Thanks for letting me know about that. It is now fixed.

This is a great base for what I’ve wanted as a post-commit script.

It would be nice if there were options for ViewVC-type links, and other things.

I’ve added that stuff hard-coded to my situation, but I may go back through and make them more generic. Are those changes something you be interested in seeing back, or are you at the “wash my hands of it” stage?

Just in case someone using this isn’t familiar with ActionMailer, you can configure it to authenticate against a mail server like so:

ActionMailer::Base.smtp_settings = {
:address => “mail server address”,
:port => 25,
:domain => “mail domain”,
:authentication => :login,
:user_name => “mail account”,
:password => “password”
}

We’ve found this script incredibly helpful - many thanks! But we’ve just switched to git, and miss it terribly… has anyone ported this to git?

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.