Subversion pre-commit hook
Posted on 2006-05-02
Hi I use TortoiseSVN on Windows and have a running SVN Server without apache just the svn daemon.
I need a pre-commit hook that forces users to make a log entry.
The example file of the pre-commit hook contains code for this but it doesn't work.
When I use the example file for real I cannot commit with or withour log message.
Furthermore I don't get the stdErr that should be passed to the Client.
It just says that the commit has failed but without giving the reason that is printed to stdErr.
Here is the code I'm using right now and which doesn't work in any way.
# Make sure that the log message contains some text.
$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null || exit 1
# Check that the author of this commit has the rights to perform
# the commit on the files and directories being modified.
commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1
# All checks passed, so allow the commit.
I need a hook script that
b) passes the stdErr to the client so that the User knows why the commit has failed.