You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Henderson, Michael D" <mi...@lmco.com> on 2004/11/24 20:19:46 UTC

Hook scripts vs Hook intepreter

I'd like to extend hooks a bit by embedding an interpreter in svnserve. Maybe I'm looking at solving a problem that doesn't exist, but doing so would allow the server to run a script internally rather than shelling out to a script every time.

I'm looking at using lua or ferite for the interpreter. lua's small and fast. ferite is fun. I'm also comfortable with both. lua can pre-parse a script, which helps on repeated calls.

Is this something that *should* be done? I don't see a lot (read "no one") clamoring for such a feature. Most of the functionality of hooks I've seen could easily be handled without calling the shell. For those that couldn't, hook scripts could still be called.

Plus, the interpreted scripts would be portable to other operating systems. The problem that originally got me to thinking about this was ACLs. It looks to be easy (and fast) to run an interpreted script to check and enforce permissions. Plus, as a script, a replacement system could be dropped in without recompiling if the interface was identical.

Would there be a performance hit that I'm not seeing?

I don't use svn over Apache, so I haven't given any thought to mod svn. Is there a place/way to put in a change like this so that both could share?

Thanks,
Mike

Interviewer: Do you feel you've learnt by your mistakes here? 

Sir Arthur: I think I have, yes, and I think I can probably repeat them almost perfectly. I know my mistakes inside out.


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

Re: Hook scripts vs Hook intepreter

Posted by kf...@collab.net.
"Henderson, Michael D" <mi...@lmco.com> writes:
> I'd like to extend hooks a bit by embedding an interpreter in
> svnserve. Maybe I'm looking at solving a problem that doesn't exist,
> but doing so would allow the server to run a script internally rather
> than shelling out to a script every time.
> 
> I'm looking at using lua or ferite for the interpreter. lua's small
> and fast. ferite is fun. I'm also comfortable with both. lua can
> pre-parse a script, which helps on repeated calls.
> 
> Is this something that *should* be done? I don't see a lot (read "no
> one") clamoring for such a feature. Most of the functionality of hooks
> I've seen could easily be handled without calling the shell. For those
> that couldn't, hook scripts could still be called.

I'm speaking solely for myself, but I wouldn't want to see this
complexity incorporated into our servers right now.  Like you said, no
one's been clamoring for it, and Perl, Python, or other scripting
language hook scripts are already portable across operating systems.
(Remember, you don't have to use shell language for hooks.)

-Karl

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

Re: Hook scripts vs Hook interpreter

Posted by Mark Phippard <Ma...@softlanding.com>.
"Henderson, Michael D" <mi...@lmco.com> wrote on 11/24/2004 
03:19:46 PM:

> I'd like to extend hooks a bit by embedding an interpreter in svnserve. 
Maybe 
> I'm looking at solving a problem that doesn't exist, but doing so would 
allow 
> the server to run a script internally rather than shelling out to a 
script every time.
> 
> I'm looking at using lua or ferite for the interpreter. lua's small and 
fast. 
> ferite is fun. I'm also comfortable with both. lua can pre-parse a 
script, 
> which helps on repeated calls.
> 
> Is this something that *should* be done? I don't see a lot (read "no 
one") 
> clamoring for such a feature. Most of the functionality of hooks I've 
seen 
> could easily be handled without calling the shell. For those that 
couldn't, 
> hook scripts could still be called.
> 
> Plus, the interpreted scripts would be portable to other operating 
systems. 
> The problem that originally got me to thinking about this was ACLs. It 
looks 
> to be easy (and fast) to run an interpreted script to check and enforce 
> permissions. Plus, as a script, a replacement system could be dropped in 

> without recompiling if the interface was identical.
> 
> Would there be a performance hit that I'm not seeing?
> 
> I don't use svn over Apache, so I haven't given any thought to mod svn. 
Is 
> there a place/way to put in a change like this so that both could share?

Hooks are in libsvn_repos, so if you implemented a feature like this, it 
would work for all access methods.  Are these interpreters portable to all 
of the operating systems that Subversion and APR support? 

Finally, isn't there a stability advantage to running the scripts in a 
separate process?  Perhaps not.

It is an interesting idea.  Portability of the interpreter would be my 
concern.

Mark


_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. by IBM Email Security Management Services powered by MessageLabs. 
_____________________________________________________________________________

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