[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Restricting permissions on tags and branches

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2004-12-17 17:22:40 CET

Jennifer: it's best to send these sorts of questions to the users@
list, rather than one person. Instead of getting one response, you're
like to get a whole bunch of helpful responses. And the public traffic
has the side effect of helping other people reading the list with the
same questions. So please keep this discussion on the list. :-)

On Dec 17, 2004, at 9:57 AM, Jennifer Kesterson wrote:

> Ben, please forgive my ignorance.  I'm not a programmer.  When I look
> at the sample pre-commit hook script, and I see the example inside, it
> looks easy enough for the average programmer but I wouldn't know what
> to write, not knowing the language.  I can see that it is calling a
> commit-access-control.cfg file.  But what is in that file??  I'm at a
> loss as to what to write and what might go in the files called by
> these sample hook scripts.

The example "template" hooks are Unix shell scripts. If you don't know
Unix or it's built-in scripting, then it's useless to you. But the
point is that the hook script can be *any* program at all: a windows
batch file, a compiled program (written C++, Java, .NET, whatever),
perl, python. It doesn't matter. Choose whatever language you're
comfortable with.

The main point of the template is to illustrate that whatever, the hook
program is, Subversion will pass specific arguments to it when running
it. In the case of the hook program named 'pre-commit', the two
arguments are

    pre-commit /path/to/repository name-of-pending-transaction

Your hook program should read those incoming arguments, and then
inspect the pending transaction. If the transaction is good, return
success. If not, return failure. Your hook program can use any number
of tools to inspect the transcation: the 'svnlook' program is good for
this, or you can use libraries (C, perl, python, java) to do the work.

> Is there another source that spells it out, such as Subversion Hook
> Scripts for Non-Programmers and other Dummies? :-)  I'm ready to hand
> this back to the whiz-bang programmer who assigned it to me.

Honestly -- no offense to you -- you should hand back the task to the
programmer, or at least this portion of the task. Subversion was
designed with the assumption that the administrators responsible for
deploying the system have some ability to write scripts in *some*
language. It's a pretty common assumption for most software like this.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Dec 17 17:25:23 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.