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

pre/post command hook

From: <webpost_at_tigris.org>
Date: Wed, 4 Mar 2009 17:31:58 -0800 (PST)

Are there any plans to implement pre/post command hooks? Or... is there any chance this could be added?

What I mean by "command" hook is a script that's called before ANY command is executed regardless if it changes the repository or not. So... even a "checkout", "status" or "log" command would trigger this hook script.

NOTE: Access to all my repositories is via svn+ssh://, so even though some of the following may be possible vi apache, that's not an option for me.

The primary reasons I'd like to see this are:

  1. It would provide a way to temporarily disable a repository so off-line maintenance can be done. I could rename the existing repository and create a temporary dummy repository of the same name that includes a "pre-command" hook script which disallows all access along with a message "System maintenance, try again in an hour".

  2. It would provide a way to do connection level logging. I often need to know how busy a repository is or the last time it was accessed (not changed... but accessed). With a pre-command (or possibly post-command) hook script, I believe I could create a log with at least the date,client ip, user and repository... hopefully also the command, command args and result of the command.

I think the only difference between the pre-command and post-command would be the post-command includes the result of the command (successful or not) and any specific error message, if that's possible.

If there's another way to accomplish either of the 2 goals above, given the restriction that it must work for svnserve (via svn+ssh://), I'd be happy to consider that as well.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1269726
Received on 2009-03-05 11:44:52 CET

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

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