+#!/bin/sh\r
+\r
+# PRE-COMMIT HOOK\r
+#\r
+# The pre-commit hook is invoked before a Subversion txn is\r
+# committed. Subversion runs this hook by invoking a program\r
+# (script, executable, binary, etc.) named 'pre-commit' (for which\r
+# this file is a template), with the following ordered arguments:\r
+#\r
+# [1] REPOS-PATH (the path to this repository)\r
+# [2] TXN-NAME (the name of the txn about to be committed)\r
+#\r
+# The default working directory for the invocation is undefined, so\r
+# the program should set one explicitly if it cares.\r
+#\r
+# If the hook program exits with success, the txn is committed; but\r
+# if it exits with failure (non-zero), the txn is aborted, no commit\r
+# takes place, and STDERR is returned to the client. The hook\r
+# program can use the 'svnlook' utility to help it examine the txn.\r
+#\r
+# On a Unix system, the normal procedure is to have 'pre-commit'\r
+# invoke other programs to do the real work, though it may do the\r
+# work itself too.\r
+#\r
+# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT ***\r
+# *** FOR REVISION PROPERTIES (like svn:log or svn:author). ***\r
+#\r
+# This is why we recommend using the read-only 'svnlook' utility.\r
+# In the future, Subversion may enforce the rule that pre-commit\r
+# hooks should not modify the versioned data in txns, or else come\r
+# up with a mechanism to make it safe to do so (by informing the\r
+# committing client of the changes). However, right now neither\r
+# mechanism is implemented, so hook writers just have to be careful.\r
+#\r
+# Note that 'pre-commit' must be executable by the user(s) who will\r
+# invoke it (typically the user httpd runs as), and that user must\r
+# have filesystem-level permission to access the repository.\r
+#\r
+# On a Windows system, you should name the hook program\r
+# 'pre-commit.bat' or 'pre-commit.exe',\r
+# but the basic idea is the same.\r
+#\r
+# The hook program typically does not inherit the environment of\r
+# its parent process. For example, a common problem is for the\r
+# PATH environment variable to not be set to its usual value, so\r
+# that subprograms fail to launch unless invoked via absolute path.\r
+# If you're having unexpected problems with a hook program, the\r
+# culprit may be unusual (or missing) environment variables.\r
+# \r
+# Here is an example hook script, for a Unix /bin/sh interpreter.\r
+# For more examples and pre-written hooks, see those in\r
+# the Subversion repository at\r
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and\r
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/\r
+\r
+\r
+REPOS="$1"\r
+TXN="$2"\r
+\r
+# Make sure that the log message contains some text.\r
+SVNLOOK=/usr/local/bin/svnlook\r
+$SVNLOOK log -t "$TXN" "$REPOS" | \\r
+ grep "[a-zA-Z0-9]" > /dev/null || exit 1\r
+\r
+# Check that the author of this commit has the rights to perform\r
+# the commit on the files and directories being modified.\r
+commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1\r
+\r
+# All checks passed, so allow the commit.\r
+exit 0\r