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

Re: Restrict the commit operation with pre-commit hook

From: Ryan Schmidt <subversion-2009b_at_ryandesign.com>
Date: Tue, 10 Nov 2009 17:06:33 -0600

On Nov 10, 2009, at 01:11, S Prabhu wrote:

> I want to restrict the commit operation when the log(Commit) message
> empty
> or characters count is less than 25.

The default pre-commit hook script provided in every new repository
you create does that (prevents commits with empty log messages):

#!/bin/sh

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

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

If your server is not Windows, simply rename the "pre-commit.tmpl" to
"pre-commit" and "chmod 755" it, and modify it as needed. (For
example, remove the lines about "commit-access-control.pl".)

If your server is Windows, then you'll need to write the script
yourself.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2416306

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-11-11 00:07:18 CET

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.