This text is a work in progress—highly subject to change—and may not accurately describe any released version of the Apache™ Subversion® software. Bookmarking or otherwise referring others to this page is probably not such a smart idea. Please visit http://www.svnbook.com/ for stable versions of this book.

Name

start-commit — Notification of the beginning of a commit.

Synopsis

start-commit REPOS-PATH USER CAPABILITIES TXN-NAME

Description

The start-commit hook is run immediately after the commit transaction is created and its initial properties set. It is typically used as an early termination mechanism, avoiding what could be a lengthy commit process which would eventually fail at a later phase anyway due to a user's lack of commit privileges or some other commit metadata validation failure.

If the start-commit hook program returns a nonzero exit value, the commit process is stopped, the commit transaction is destroyed, and anything printed to stderr is marshalled back to the client.

The start-commit hook is not a suitable place to evaluate the substance of a particular commit, as it is invoked before any file or directory change information has been transmitted. Use the pre-commit hook script (which is described in pre-commit elsewhere in this reference) for that purpose.

[Note] Note

Prior to Subversion 1.8, the Subversion invoked the start-commit hook before creating the commit transaction. Failure of the script resulted in that transaction not being created at all. This was changed in Subversion 1.8, though, to allow implementations of the start-commit hook access to the transaction's properties, which can include (among other things) the revision log associated with the commit.

Input Parameter(s)

The command-line arguments passed to the hook program, in order, are:

  1. Repository path

  2. Authenticated username attempting the commit

  3. Colon-separated list of capabilities that a client passes to the server, including depth, mergeinfo, and log-revprops (new in Subversion 1.5)

  4. Commit transaction name (new in Subversion 1.8)

Common uses

Access control (e.g., temporarily lock out commits for some reason).

A means to allow access only from clients that have certain capabilities.