1 | #!/bin/sh |
---|
2 | |
---|
3 | # START-COMMIT HOOK |
---|
4 | # |
---|
5 | # The start-commit hook is invoked before a Subversion txn is created |
---|
6 | # in the process of doing a commit. Subversion runs this hook |
---|
7 | # by invoking a program (script, executable, binary, etc.) named |
---|
8 | # 'start-commit' (for which this file is a template) |
---|
9 | # with the following ordered arguments: |
---|
10 | # |
---|
11 | # [1] REPOS-PATH (the path to this repository) |
---|
12 | # [2] USER (the authenticated user attempting to commit) |
---|
13 | # |
---|
14 | # The default working directory for the invocation is undefined, so |
---|
15 | # the program should set one explicitly if it cares. |
---|
16 | # |
---|
17 | # If the hook program exits with success, the commit continues; but |
---|
18 | # if it exits with failure (non-zero), the commit is stopped before |
---|
19 | # a Subversion txn is created, and STDERR is returned to the client. |
---|
20 | # |
---|
21 | # On a Unix system, the normal procedure is to have 'start-commit' |
---|
22 | # invoke other programs to do the real work, though it may do the |
---|
23 | # work itself too. |
---|
24 | # |
---|
25 | # Note that 'start-commit' must be executable by the user(s) who will |
---|
26 | # invoke it (typically the user httpd runs as), and that user must |
---|
27 | # have filesystem-level permission to access the repository. |
---|
28 | # |
---|
29 | # On a Windows system, you should name the hook program |
---|
30 | # 'start-commit.bat' or 'start-commit.exe', |
---|
31 | # but the basic idea is the same. |
---|
32 | # |
---|
33 | # Here is an example hook script, for a Unix /bin/sh interpreter: |
---|
34 | |
---|
35 | REPOS="$1" |
---|
36 | USER="$2" |
---|
37 | |
---|
38 | commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1 |
---|
39 | special-auth-check.py --user "$USER" --auth-level 3 || exit 1 |
---|
40 | |
---|
41 | # All checks passed, so allow the commit. |
---|
42 | exit 0 |
---|