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

Re: update hook per project (or directory)

From: Jan Hendrik <jan.hendrik_at_myrealbox.com>
Date: 2007-03-17 13:25:58 CET

Concerning Re: update hook per project (or dir
Ryan Schmidt wrote on 6 Mar 2007, 21:49, at least in part:


> Maybe threads isn't the right word. But what I meant to say:
> Anything you do just in the post-commit hook, or any script the post-
> commit hook calls, or any script called by such a script, and so
> forth, is fine.
> However, if you fork off a new process (create a thread, whatever),
> then that is a separate process and the post-commit hook itself can
> end before the forked process does, and that's when problems as
> described above can start.
> So, by (Unix) example (since I don't know Windows):
> If my post-commit hook is...
> #!/bin/sh
> REPOS="$1"
> REV="$2"
> /path/to/some-other-script.sh "$REPOS" "$REV"
> ....then everything is fine, because post-commit will wait for some-
> other-script.sh to finish before it finishes.
> However, if my post-commit hook is...
> #!/bin/sh
> REPOS="$1"
> REV="$2"
> /path/to/some-other-script.sh "$REPOS" "$REV" >/dev/null 2>/dev/null &
> ....then some-other-script.sh has been forked off into its own
> process, and post-commit ends immediately, before some-other-
> script.sh is done running, which can cause the possible problems as
> mentioned above.

I am not very versed with pipes, but if the output/result/whatever of
a script/program is directed elsewhere (>/dev/null ...) then this is a
fork-off or new thread and the calling script would not wait for stuff?
Logical enough. What you wrote also reminds me of a couple of
scripts I use here for some operations on both local and remote
stuff. The local script calls a complementary script on the remote
system (telnet/ssh) and then waits for the remote script to finish,
and if the connection to the remote system breaks occasionally I
have to kill the local script process. Guess I understand this
business better now. Thanks, Ryan.

Freedom quote:

     Freedom makes a huge requirement of every human being.
     With freedom comes responsibility.
     For the person who is unwilling to grow up,
     the person who does not want to carry is own weight,
     this is a frightening prospect.
               -- Eleanor Roosevelt

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Mar 17 13:25:29 2007

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.