You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Bojan Mihelač <bm...@mihelac.org> on 2007/02/05 20:29:18 UTC

Does commit wait for post-commit hook to execute?

Hello all,

does 'svn commit' waits for post-commit hook to execute or it returns 
immediately?

thanks for answer,
Bojan Mihelac
-- 
Bojan Mihelač
Informatika Mihelac  | T: +386(0)1 428 93 43  | M: +386(0)40 306 813
www.informatikamihelac.com  | www.enter-net.biz | source.mihelac.org
-> Novo: www.MOJGOST.com - web servis za vodenje privatnog smjestaja

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

Re: Does commit wait for post-commit hook to execute?

Posted by Bojan Mihelač <bm...@mihelac.org>.
I get it, thanks for valuable answers
best regards
Bojan Mihelac

Ryan Schmidt wrote:
> 
> On Feb 6, 2007, at 15:24, Andy Levy wrote:
> 
>> On 2/5/07, Bojan Mihelač wrote:
>>
>>> does 'svn commit' waits for post-commit hook to execute or it returns
>>> immediately?
>>
>> svn commit "finishes" when the post-commit hook completes finishes
>> executing. If your post-commit is lengthy and you need quicker
>> response, have post-commit spawn a new process to actually do that
>> work, letting post-commit return. Doing this in any hook script means
>> you'll lose the ability to send feedback to the user regarding that
>> spawned process.
> 
> ...however this is not a problem for the post-commit hook, since you 
> can't send any feedback from that hook anyway.
> 
> Note that if you want to spawn another process with the intention of 
> completing the post-commit quicker, you may also need to direct the 
> spawned process's stdout and stderr to /dev/null, else the post-commit 
> hook may still wait for the spawned process to complete.
> 
> -- 
> To reply to the mailing list, please use your mailer's Reply To All 
> function
> 
> 
> 
> 
> 

-- 
Bojan Mihelač
Informatika Mihelac  | T: +386(0)1 428 93 43  | M: +386(0)40 306 813
www.informatikamihelac.com  | www.enter-net.biz | source.mihelac.org
-> Novo: www.MOJGOST.com - web servis za vodenje privatnog smjestaja

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

Re: Does commit wait for post-commit hook to execute?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 6, 2007, at 15:24, Andy Levy wrote:

> On 2/5/07, Bojan Mihelač wrote:
>
>> does 'svn commit' waits for post-commit hook to execute or it returns
>> immediately?
>
> svn commit "finishes" when the post-commit hook completes finishes
> executing. If your post-commit is lengthy and you need quicker
> response, have post-commit spawn a new process to actually do that
> work, letting post-commit return. Doing this in any hook script means
> you'll lose the ability to send feedback to the user regarding that
> spawned process.

...however this is not a problem for the post-commit hook, since you  
can't send any feedback from that hook anyway.

Note that if you want to spawn another process with the intention of  
completing the post-commit quicker, you may also need to direct the  
spawned process's stdout and stderr to /dev/null, else the post- 
commit hook may still wait for the spawned process to complete.

-- 

To reply to the mailing list, please use your mailer's Reply To All  
function


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


Re: Does commit wait for post-commit hook to execute?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 7, 2007, at 01:21, Andreas Schweigstill wrote:

> Andy Levy schrieb:
>
>> svn commit "finishes" when the post-commit hook completes finishes
>> executing. If your post-commit is lengthy and you need quicker
>> response, have post-commit spawn a new process to actually do that
>> work, letting post-commit return. Doing this in any hook script means
>> you'll lose the ability to send feedback to the user regarding that
>> spawned process.
>
> And probably some kind of semaphore or lock has to be used if it is
> important that there is only one spawned script running at the same
> time.
>
> Does Subversion assure that the same script won't be executed multiple
> at the same time when there are concurrent check-ins?

Yes, Subversion will only allow one commit to be taking place at a  
given time, so there can only be one post-commit hook running at a  
time. However, if you spawn off a process in your post-commit hook,  
then the post-commit hook will exit before your script is done, so  
there could be multiple copies of your spawned script running at a time.

-- 

To reply to the mailing list, please use your mailer's Reply To All  
function


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

Re: Does commit wait for post-commit hook to execute?

Posted by Andreas Schweigstill <an...@schweigstill.de>.
Hello!

Andy Levy schrieb:
> svn commit "finishes" when the post-commit hook completes finishes
> executing. If your post-commit is lengthy and you need quicker
> response, have post-commit spawn a new process to actually do that
> work, letting post-commit return. Doing this in any hook script means
> you'll lose the ability to send feedback to the user regarding that
> spawned process.

And probably some kind of semaphore or lock has to be used if it is
important that there is only one spawned script running at the same
time.

Does Subversion assure that the same script won't be executed multiple
at the same time when there are concurrent check-ins?

With best regards
Andreas Schweigstill

-- 
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstraße 116, D-24118 Kiel, Germany
Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/

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


Re: Does commit wait for post-commit hook to execute?

Posted by Andy Levy <an...@gmail.com>.
On 2/5/07, Bojan Mihelač <bm...@mihelac.org> wrote:
> Hello all,
>
> does 'svn commit' waits for post-commit hook to execute or it returns
> immediately?

svn commit "finishes" when the post-commit hook completes finishes
executing. If your post-commit is lengthy and you need quicker
response, have post-commit spawn a new process to actually do that
work, letting post-commit return. Doing this in any hook script means
you'll lose the ability to send feedback to the user regarding that
spawned process.