source: trunk/test/repo/hooks/start-commit.tmpl @ 1609

Last change on this file since 1609 was 248, checked in by Peter Johansson, 16 years ago

fixes #125

File size: 1.5 KB
Line 
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
35REPOS="$1"
36USER="$2"
37
38commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1
39special-auth-check.py --user "$USER" --auth-level 3 || exit 1
40
41# All checks passed, so allow the commit.
42exit 0
Note: See TracBrowser for help on using the repository browser.