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

Re: Hooks

From: anton <anton_at_nezzwerk.com>
Date: 2005-03-31 20:46:42 CEST

Roberto Nucera wrote:
> I'd like to have a hook that prevents a commit if ther user has not
> entered a comment. Anyone has such script? It will run on Linux.
>
> Any help appreciated,
>

look in your hooks directory for templates or online manual:

pre-commit
==========
#!/bin/sh
REPOS="$1"
TXN="$2"

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

if [ $? != 0 ]; then
     echo "\nCommit comment is required!\nPlease provide commit comment
and retry.\n\n" 1>&2
     exit 1
fi

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

-a

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Mar 31 20:57:36 2005

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.