[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Revision log entry - making them mandatory

From: Milen A. Radev <milen_at_radev.net>
Date: Wed, 23 Jan 2008 15:30:06 +0200

On 23/01/2008, Andy Levy <andy.levy_at_gmail.com> wrote:
[...]
> Your best bet is to install a pre-commit hook script which rejects any
> commit having a log message length of 0 (or less than some reasonable
> character count).

Like this one (I'm sure there are many other available "out there"):

======================================
#!/bin/sh

REPOS="$1"
TXN="$2"
# Make sure that the log message contains some text.
MIN_LENGTH=5
SVNLOOK=/usr/bin/svnlook
LOG_MSG=`$SVNLOOK log -t "$TXN" "$REPOS"`
LOG_MSG_LEN=${#LOG_MSG}

if [ $LOG_MSG_LEN -le $MIN_LENGTH ]
then
  echo -e "\nPlease enter message longer than $MIN_LENGTH characters!" 1>&2
  exit 1
elif echo $LOG_MSG | grep -v "[a-zA-Z0-9]" > /dev/null
then
  echo -e "\nPlease enter a meaningful log message!" 1>&2
  exit 1
fi
# All checks passed, so allow the commit.
exit 0
======================================

This assumes you repository/-ies are on Unix/Linux.
Tweak it according to your setup.

-- 
Milen A. Radev
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_tortoisesvn.tigris.org
For additional commands, e-mail: users-help_at_tortoisesvn.tigris.org
Received on 2008-01-23 14:30:18 CET

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.