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

Re: forcing log entry during commit

From: Ryan Schmidt <subversion-2006c_at_ryandesign.com>
Date: 2006-07-08 19:51:12 CEST

On Jul 7, 2006, at 22:34, Brian Krusic wrote:

> I would like to force users to write a log entry about the nature
> of the commit and have seen a hook script called enforcer that may
> help me do this.
>
> Would some one mind getting me started on how to do this?
>
> I imagine referancing some SVN variable to check if its not blank.
>
> Perhaps the some thing that checks for a new line would do?

We use this script. Call it "pre-commit", put it in your repository's
hooks directory, and make sure it's readable and executable by Apache
or svnserve or whatever's serving your repository:

#!/bin/sh

REPOS="$1"
TXN="$2"

# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null

if [ $? != 0 ]; then
         echo "Please enter a commit message." 1>&2
         exit 1
fi

# All checks passed, so allow the commit.
exit 0

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Jul 8 19:52:26 2006

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

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