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

RE: using/creating hooks within subversion...

From: bruce <bedouglas_at_earthlink.net>
Date: 2004-08-26 01:04:13 CEST

karl...

that was the section that i had seen/read. as i stated, i'm not ready to
climb the hill to implement subversion/apache yet, so i can't use the tools
provided by apache. and, as i pointed out, the apache solution appears to
still require i update/modify text files on a continual basis...

the 'hook's discussed in the doc appear to only be focused around the
commit/properties processes. does this imply that i can't create a 'hook'
app for any other 'svn' process..

as i said before the docs in ch #5 don't provide a clear illustration on how
to do this...
(http://svnbook.red-bean.com/svnbook/ch05s02.html#svn-ch-5-sect-2.1)

as a real world example:

i'd like to be able to have a 'hook' created on the checkout process.
whenever a user tries to checkout something from a dir from the repository,
i'd like to be able to run a hook/app that will examine the user's
usernam/passwd to determine if the user has the rights to access that given
dir/file.

what are the steps that i might go through to do this? is this an
easy/straightforward process? do i have to climb in the underlying
svnserve/svn codebase to accomplish this? how do i determine what to call
the 'hook'? how do i allow svn/svnserve to utilize the hook? how do i
'inform' the svn/svnserve app of the existance of the 'hook'...

i suppose i really need a good example of the process of
creating/implementing a brand new 'hook'.....

thanks...

-bruce

-----Original Message-----
From: kfogel@newton.ch.collab.net [mailto:kfogel@newton.ch.collab.net]On
Behalf Of kfogel@collab.net
Sent: Wednesday, August 25, 2004 1:39 PM
To: bedouglas@earthlink.net
Cc: users@subversion.tigris.org
Subject: Re: using/creating hooks within subversion...

"bruce" <bedouglas@earthlink.net> writes:
> in exploring the subversion docs, the concept of hooks is discussed. i'm
> interested in understanding how a given hook/template is called. the docs
> discussed the sample hooks, and the naming of the hooks, but i couldn't
find
> information on how i could write a hook of my own, and have it be called.
>
> as an example, if i wrote a hook and called it foo.pl, how would i tell
the
> svn/svnserve functions to use it.

If it's a post-commit hook, you have the 'post-commit' program invoke
'foo.pl', in whatever way programs invoke other programs. The exact
method depends on what language you wrote 'post-commit' in. If it's
a Unix shell script, you can simply say "foo.pl", for example.

But see below...

> i'm considering something where a user would use a hook when attempting to
> access the svn repository. the client would 'send' a username/passwd. the
> hook would access a db based upon the usernam/passwd to determine what
> dirs/files the user has access to. the hook would either grant/deny access
> to the user.
>
> but i have no idea as to how to integrate this kind of function within the
> framework of subversion...
>
> the reaon i'm looking at this kind of soln is that i'm considering an app
> that will have alot of dirs/files that will be created/added/deleted from
> the repository. using apache to provide the access control would probably
> entail a great deal of editing the httpd.conf file as dirs are changed,
> which isn't something i'd want to maintain over time...
>
> searching through the docs/google hasn't shed any light on this issue...
>
> any assistance/comments/pointers/samples/etc... would be greatly
> appreciated...

Can you say exactly what documents you read (give us URLs)? Because
access control is discussed in various places, including the book, and
for the most part it's done through mechanisms other than hooks.

   http://svnbook.red-bean.com/svnbook/book.html#svn-ch-6-sect-3.2

...comes to mind.

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Aug 26 01:01:12 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.