Minimum SVN Log Message Length

Update 2010-04-07: Stefan Küng, TortoiseSVN lead developer, commented that you can simply set the tsvn:logminsize property on your folders and the commit button in TortoiseSVN will be disabled until the log message contains at least as many characters as the value of the property.

While working on the Stars-Nova project at we wanted to prevent developers from accidentally making commits to Subversion (SVN) without providing a log message. Sometimes developers simply forget to enter a log message, leaving the rest of the team in the dark as to what changes they have made to the repository. You can diff the modified files to try to figure out what they have done, but a short message in the revision log would save you that time. Even experienced developers might on occasion slip and commit with an empty message. Luckily allows you to correct the log message after the commit has been made (command line: svn propset svn:log "new log message" -r80 --revprop <repository URL>), but that might not be the case for your choice of SVN hosting provider. It might take a while before the developer who forgot to enter the message is made aware of the issue and can correct it so we would rather get the commit right the first time around and save us the trouble.

SVN allows arbitrary server-side scripts to be configured to run on various events (pre-commit, post-commit, etc.). These script hooks offer a lot of flexibility and would have been a good place to centrally enforce a non-empty log message policy. However, because of security reasons, and all other SVN hosting providers I know of, does not allow user-defined server-side hook scripts. Instead provides a short list of predefined scripts and a check on log message length is not among the scripts that are included. I have submitted a feature request at suggesting that they add a server-side hook script such as this and I encourage you to vote for it.

Most of the developers on Stars-Nova use TortoiseSVN and this SVN client just happens to support client-side hook scripts. Based on that I wrote a small script (mmm… JScript) that prevents the user from accidentally executing a commit without providing a message. Currently it does not trim leading and trailing spaces, new lines or other non-printable characters before the character count is checked. However, the minimum character count can be configured so that an accidental space or new line (new lines are composed of two characters: carriage return and line feed) will also stop the commit.


  1. Make sure you have a recent version of TortoiseSVN (min. v1.5).
  2. Open the TortoiseSVN Settings dialog (right-click a folder in Windows Explorer > TortoiseSVN > Settings).
  3. Go to “Hook Scripts” and click “Add…”.
  4. Choose Hook Type: Pre-Commit Hook
  5. Set the Working Copy Path to the directory (or any parent directory) where you checked out your working copy from SVN. “C:\” works as well if you want this script to always execute when you run commit on working copies located anywhere on your C drive.
  6. Set Command Line To Execute: WScript <path to script>\MinMessageLength.js
  7. Ensure that “Wait for script to finish” is checked.
  8. Ensure that “Hide the script while running” is checked.
  9. (Optional) Configure the minimum number of characters allowed by changing  the MIN_CHARACTERS variable in the script.

Download the TortoiseSVN client-side hook script

Progress report for the past week

I’ve read a lot about about messaging systems, JMS and how they relate to publish-subscribe, but I think I need to start programming to get a feel for what it really is about. The Enterprise Integration Patterns book that I’m borrowing has kept me busy most of the week. I’ve also drawn a few other models for the system with different level of abstraction. You can view the new models in this PDF: Location-based event system models.

I’ve checked out Apache MQ and is seems like something I can use. It supports lots of different transport protocols for message exchange and the configuration doesn’t seem to be too tricky. It also supports JMS 1.1 which is the latest version of JMS. I also tested Git a bit and I’ve decided to start using it on this project. At the surface it doesn’t seem to be very much different from Subversion, which I’m used to, but the fact that you can commit to a local repository/index is a big bonus. I look forward to explore the distributed features in Git.

Estimated time used for the project the past week: 38 hours

Progress report for week 35

The DECS project was started on 2007-08-27 as a computer engineering project at the University of Stavanger, Norway. The final report must be delivered by 2007-12-14.

During the last week I have registered DECS as a project on Google Code which provides version control by Subversion, a simple wiki, issue tracking and a release management system. I’ve worked on setting up my C/C++ development environment by installing Eclipse with CDT (C/C++ Development Toolkit) plus MinGW and MSYS for the tool chain (compiler, linker, make, gdb, etc.). I’ve made a draft of the system architecture with MS Visio 2007 and a project plan with MS Project 2007. I also made a draft of the report structure as well as rereading Donald Knuth’s Dancing Links paper.

NOTE: This post has been imported from my old it’s learning ePortfolio DECS blog.

General Algorithm Library (GAL)

I have published code for some general algorithms implemented in Java. Most of this work was done as part of the Algorithm and Complexity Theory (MID170) course at the University of Stavanger. The general algorithms umbrella covers most algorithms, but with a slight emphasis on flexibility and performance.

The first revision contains:

  • Dijkstra’s shortest path algorithm
  • Kruskal’s MST algorithm (incomplete)
  • Stable in-place quicksort
  • Union find for locating the k-th smallest key (not complete at all)
  • Sequence union for merging two sorted sequences into a set

You can grab a copy of the first release at the end of this post or you may fetch the smoking fresh, bleeding edge, bug ridden, latest revision directly from the Subversion (SVN) repository by the magic of the command line client:

svn checkout svn:// trunk

If you prefer a GUI client I recommend TortoiseSVN (Windows), RapidSVN (Windows, Linux, Mac) and Subversive (Eclipse plugin). You may also browse the latest and greatest code from the online FishEye repository viewer which provides a more developer oriented overview.

I welcome improvements that makes the algorithms more efficient or generally easier to use as long as the changes are relatively comprehensible. Hopefully more comprehensible than it currently is.

NOTE: This post has been imported from my old it’s learning ePortfolio project blog.