background preloader

SVN

Facebook Twitter

XP-Dev.com - Subversion Hosting, Project Tracking & Agile To. Blog Archive » Subversion post commit email hook, in Ruby. I’m a big believer in tools.

Blog Archive » Subversion post commit email hook, in Ruby

Personally, I believe that better engineers tend to use better tools, but that’s a subject to explore in another post. Here’s a handy Ruby script that sends a descriptive email after each subversion checkin. The script is based on the one written by Elliott Hughes. Somehow I seem to rewrite this script every time I take a new job, so I’m pleased to release this one into the public domain. The script lists all files that were added, removed, or modified. If you’re going to use this with a sizable engineering team, I recommend changing the HTML email to include a photo of the person who committed the change. Also, it’s nice to have the “modified” lines link to the diff. Please excuse my amateurish Ruby. To install: Copy the script to hooks/post-commit in your subversion repository.Make the script executable.Modify the ADDRESS constant at the top of the file. You can download the script or copy and paste it from below:

Version Control with Subversion. Before jumping into the broader topic of repository administration, let's further define what a repository is.

Version Control with Subversion

How does it look? How does it feel? Does it take its tea hot or iced, sweetened, and with lemon? As an administrator, you'll be expected to understand the composition of a repository both from a logical perspective—dealing with how data is represented inside the repository—and from a physical nuts-and-bolts perspective—how a repository looks and acts with respect to non-Subversion tools.

The following section covers some of these basic concepts at a very high level. Understanding Transactions and Revisions Conceptually speaking, a Subversion repository is a sequence of directory trees. Every revision begins life as a transaction tree. Updates work in a similar way. The use of transaction trees is the only way to make permanent changes to a repository's versioned filesystem.

Subversion dev list archives. Version Control with Subversion. Subversion (software) Apache Subversion (often abbreviated SVN, after the command name svn) is a software versioning and revision control system distributed as free software under the Apache License.[1] Developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation.

Subversion (software)

Its goal is to be a mostly compatible successor to the widely used Concurrent Versions System (CVS). The corporate world has also started to adopt Subversion. A 2007 report by Forrester Research recognized Subversion as the sole leader in the Standalone Software Configuration Management (SCM) category and as a strong performer in the Software Configuration and Change Management (SCCM) category.[2] Subversion was created by CollabNet Inc. in 2000, and is now a top-level Apache project being built and used by a global community of contributors. History[edit] Features[edit] Repository types[edit] Subversion offers two types of repository storage. Berkeley DB (deprecated[7])[edit] Version Control with Subversion. A better Subversion post-commit hook than <tt>commit-email. I finally got round to automating sending out commit emails for our Subversion repositories.

A better Subversion post-commit hook than <tt>commit-email

I tried the supplied post-commit.tmpl and commit-email.pl, but they suck. Six hundred lines of Perl and no effort made to color the patch or format the check-in comment? I knocked up something that isn't going to win any beauty contents unless it's only up against commit-email.pl, in which case it should be a walk-over. Here's the script; as usual, the latest version will be in salma-hayek: #! # A Subversion post-commit hook. . # You *will* need to change these. address="software@jessies.org"sendmail="/usr/sbin/sendmail"svnlook="/opt/subversion-1.1.0-rc2/bin/svnlook" require 'cgi' # Subversion's commit-email.pl suggests that svnlook might create files.Dir.chdir("/tmp") # What revision in what repository?

# Get the overview information.info=`#{svnlook} info #{repo} -r #{rev}`info_lines=info.split("\n")author=info_lines.shiftdate=info_lines.shiftinfo_lines.shiftcomment=info_lines body = "" Subversion.tigris.org.