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

Re: Checkout hooks? (summary and script implementation)

From: Adrian Hoe 贺文耀 <mailbox_at_adrianhoe.com>
Date: 2006-03-28 09:35:39 CEST

Sorry for the late reply. I was on travel and got my hands tied up.

The reason I wish to have a pre/post checkout/update hooks is that,
people such as project managers and svn administrator can be alerted
with emails while they are away from their office desks.

We don't have an Apache setup simply because our security policies
and we don't want to provide conveniences of source browsing using
browsers. We sees no reasons to install Apache too because svn+ssh is
enough to do the job.

We are able to use the hooks provided to monitor all commits (post).
The problem is that we are unable to know who checkout what. That's a
security concern. We would also like to know the ip address of the
person who checkout the items. We don't know who until he/she commits
changes.

I am using 1.2.x and have no plan to migrate to 1.3 at this moment. I
will certainly migrate immediately if future version has checkout/
export/update hooks implemented.

On Mar 27, 2006, at 2:12 AM, Ryan Schmidt wrote:

> On Mar 26, 2006, at 11:52, Andrew Gabriel wrote:
>
>> Adrian Hoe 贺文耀 wrote:
>>
>>> Look. I am not talking about having to log checkout/update. I just
>>> want a simple email sent out to designated persons when someone do a
>>> svn checkout/update. I am just interested to know who and when
>>> checkout what. Simple.
>>
>> In a previous job, using a proprietary source control system, we
>> used the equivalent of a checkout hook to add people to a mailing
>> list regarding the repository they checked out from. With
>> Subversion, I can't do this until the first time they commit, so
>> it would be useful to me too so I could do it on the checkout. (We
>> only use the svn:// access method at the moment).
>
> So it sounds like several people (3 so far in this thread alone)
> want a pre- or post-checkout hook. (And I see for the first time
> now, Adrian, that you also want a pre- or post-update hook.)
> Someone even already implemented a pre-checkout / pre-update hook,
> the patch for which is here:
>
> On Mar 24, 2006, at 16:00, Mathias Weinert wrote:
>
>> You may want to look at
>> http://svn.haxx.se/dev/archive-2006-02/0304.shtml
>> and a little follow-up discussion in a separate thread for which
>> I don't have the number available at the moment (the subject
>> is "Re: [PATCH] pre-update and pre-getfile hook").
>
> There's some controversy about the way in which this feature was
> implemented, which you can read about in the continued discussion
> Matthias mentioned:
>
> http://svn.haxx.se/dev/archive-2006-03/0033.shtml
>
> One of the perceived problems was that a pre-checkout hook can be
> seen as another authorization mechanism, which was thought to be a
> bad idea (the better idea presumably being to extend the existing
> authorization mechanism to offer whatever features people would be
> implementing in a pre-checkout hook).
>
> For the purposes of this thread, all that's desired is
> notification, which would probably fit best into a post-checkout or
> post-update hook. I can't find an issue tracker record for this
> request. Is there a reason, or would anybody object to such an
> enhancement request being filed?
>
>
> So friends, until such new hooks are implemented, I think the only
> way to get what you want is to serve your repository using Apache
> and monitor the Subversion access log. Fortunately, since I'm
> trying to avoid real work at the moment, I wrote you a nifty script
> which can be used in conjunction with the new Apache access log
> features in Subversion 1.3.0 to basically create the post-checkout-
> or-export and post-update hooks out of thin air. The script is
> written in PHP, because I like it. The server must therefore be
> running Apache 2.0.x or greater, Subversion 1.3.x or greater, and
> PHP. (I'm running 5.1.2 but 4.3.x or greater should probably be
> fine; if not, let me know.) I would like for the script to work on
> Windows too, but I can't test that; it's tested to work on Mac OS
> X. Instructions and hook templates are included in the archive.
>
> http://www.ryandesign.com/svnhookdispatcher/
>
> I should note that the new post-checkout-or-export and post-update
> hooks get called even if the checkout, export or update is
> interrupted for some reason, so just keep that in mind.
>
>
>

--
"If you missed the rising sun and the morning dew, don't miss the  
beautiful sunset." -- Adrian Hoe inspired by Michal Nowak, June 15 2004
http://adrianhoe.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Mar 28 09:38:12 2006

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.