<2017 October>
SunMonTueWedThuFriSat
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

On this page...

Search

Links

Member of...


ASP Insiders

MVP Visual Developer ASP/ASP.NET

Enter CodeZone

Blog Categories

Microsoft

Blogroll

Deutsche Resourcen

Management

Sign In
 

#  Saturday, 09 April 2005

In the entry Subversion on Windows as a Service, plus Commit Hook and Backup Script I showed a batch file for hooking into the post commit event of a repository. This batch file annoyed me from the very beginning. During the Indigo Community Day on Thursday in Munich I decided that it was about time to get rid of it, and after yesterday's party, I thought it might be a nice pinky exercise to do the basic port to C# today.

And yes, it is very basic at the moment. All you need to do is take post-commit.exe and post-commit.exe.config from the \SvnPostCommitHook\Hook directory in the downloadable zip file and drop those two into the hooks directory of your repository. The .config file is your ticket to customization:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <appSettings>
  <add key="SvnLookPath" value="C:\Program Files\Subversion\bin\svnlook" />
  <add key="MailTo" value="commitlist@yourdomain.com" />
  <add key="MailFrom" value="commithook@yourdomain.com" />
  <add key="MailSubject" value="Your project name rev {0}, {1}" />
  <add key="MailServer" value="localhost" />
 </appSettings>
</configuration>

Just as the batch file, post-commit.exe's task is to read the change log and commit message, and post it to a mailing list that distributes the information to the project stakeholders. Therefore, you need to configure the four Mail* settings to match your configuration and preferences. The SvnLookPath needs to point to your Subversion installation, however, most installations should be fine with this default.

How can you test the operation of post-commit.exe? This is the syntax:

post-commit <repository> <revision>

For example:

post-commit e:\subversion\fidalgo 1830

In the current version, testing is highly recommended as no logging or exception handling is implemented.

SvnPostCommitHook1.0.0.50409.zip (12.07 KB)

The source code is BSD-licensed. Future plans are to fully parse the svnlook output, as well as add a logging infrastructure to easily find configuration problems during normal operations of your Subversion server.

Saturday, 09 April 2005 19:34:45 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]Tracked by:
"Update for the Post Commit Hook" (this.Pose() as Expert) [Trackback]

 



Comments are closed.

© Copyright 2017 Christoph Wille

newtelligence dasBlog 2.3.9074.18820
Subscribe to this weblog's RSS feed with SharpReader, Radio Userland, NewsGator or any other aggregator listening on port 5335 by clicking this button.   RSS 2.0|Atom 1.0  Send mail to the author(s)

 
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.