You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by David Chiew <Da...@quantium.com.au> on 2008/06/30 07:37:37 UTC

Running Hook Scripts when accessing repository with file:///

Hi All,

I've been having trouble getting a subversion post-commit hook to run at
all after performing a commit.

My set up is as follows:
- Running off Windows XP
- Developers access the repository using file:///O:/Repository (a shared
network drive)
	- ie. No Apache, SubVersion server.
- Have create post-commit.bat which sits in O:\Repository\hooks

post-commit.bat never seems to execute when we commit code!

I found a similar post from Casey who had a similar issue, does anyone
know whether hooks will work under a direct file-based subversion setup?

Thanks in advance!
Dave

-----Original Message-----
From: Daniell, Casey B <Casey_Daniell_at_reyrey.com>
Date: 2006-05-11 18:49:17 CEST

 Doh, ignore that last message. I think I have found part of the
problem. This particular server is running on Windows without using
Apache or the mod_dav_svn module. Users access this repository by doing
file://rwsbuild01/ScottPlayground/

Does this change how hook scripts are called in any way? From what I
have read it shouldn't. What about the needed permission set? Is there
a generic log file generated that I can check to see what issue maybe
arising during the checking process?

-----Original Message-----
From: Daniell, Casey B
Sent: Thursday, May 11, 2006 10:17 AM
To: users@subversion.tigris.org
Subject: RE: Running Hook script on Windows

I am thinking this is a permission problem on Windows, what services
need to have write/execute abilities?

SVNServe and the Apache2 services, since SVN is running under Apache?
Any others that I am missing?

I am bumping the owner of these services up to Admin and will slowly
remove rights to figure out the right set of permissions.

Casey

-----Original Message-----
From: allan juul
Sent: Wednesday, May 10, 2006 1:40 PM
To: Daniell, Casey B
Cc: users@subversion.tigris.org
Subject: Re: Running Hook script on Windows

in you batch file make sure you are in the correct drive, like this
would be the very first line of code:

c:

(at least that works for us, but we stay on the same drive during the
whole post-commit)

i assume this must otherwise have something to do with security, has the
apache user write access to the specific directory ?

<OT>

dear all who responded on this original thread.

(assuming SVN version 1.3.1)
since you seem to have post-commits running on windows may I ask if you
could confirm that it is indeed possible to commit to the repository
without a wait for the post-commit to finish ?

for example, if you put a

   sleep 120

in your script, how long will a client's commit actual take.

we have been running these for a long time, but after upgrading to
series 1.3.* they simply doesn't work correctly anymore

</OT>

./allan

Daniell, Casey B wrote:
> I still am not seeing a file, c:\logfile.txt, created. Its like this
> script isn't even being run.
>
> I have it named post-commit.bat and, now, post-commit2.bat both
> located in the repositories hooks directory.
>
> Do I just need to place the files there and they will automatically
> get called? Or do I need to tell SVN to find them somehow?
>
> Casey
>
> -----Original Message-----
> From: Nathan Kidd
> Sent: Tuesday, May 09, 2006 4:29 PM
> To: users@subversion.tigris.org
> Subject: Re: Running Hook script on Windows
>
> Daniell, Casey B wrote:
>> Ok, I am having trouble getting my SVN hook script to run
>> automatically under windows, it runs fine by hand (I have the path
>> info included in it). When it run manually it creates a file in the C

>> drive that I can see, so I know its operating, however, when it
>> should
>
>> run under windows I get nothing, help?
>>
>> Its located in the hooks directory of the repository where the
>> checkin
>
>> is occurring, and has been renamed to post-commit.bat as per the
>> instructions, what am I missing to get this file called?
>
> To find out what's going wrong:
>
> 1. rename post-commit.bat post-commit2.bat
>
> 2. create new post-commit.bat with one line like this:
>
> call %~dp0post-commit2.bat %* > c:\logfile.txt 2>&1
>
> HTH,
>
> -Nathan

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


Re: Running Hook Scripts when accessing repository with file:///

Posted by Andy Levy <an...@gmail.com>.
On Mon, Jun 30, 2008 at 3:37 AM, David Chiew
<Da...@quantium.com.au> wrote:
> Hi All,
>
> I've been having trouble getting a subversion post-commit hook to run at
> all after performing a commit.
>
> My set up is as follows:
> - Running off Windows XP
> - Developers access the repository using file:///O:/Repository (a shared
> network drive)
>        - ie. No Apache, SubVersion server.
> - Have create post-commit.bat which sits in O:\Repository\hooks
>
> post-commit.bat never seems to execute when we commit code!
>
> I found a similar post from Casey who had a similar issue, does anyone
> know whether hooks will work under a direct file-based subversion setup?

When you use file:///, the hook scripts execute on the workstation
which performed the action (in this case the commit). So, if any
paths, drive mappings, permissions, programs, etc. are different from
what you expect in the hook script, it'll likely fail.

This is one of the many reasons that using file:/// access across a
mapped drive with multiple users is so heavily discouraged. You really
ought to be running an actual Subversion server in this situation.

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