From: Junio C Hamano Date: Mon, 05 Dec 2005 22:11:34 GMT Subject: Re: Weirdness with port-update hook and local push Message-ID: <7vk6ej9otl.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Daniel Barkalow writes: > The thing that confuses me is that it works when run from ssh or directly, > but not when run from a local push. I'd expect the two that work to be > most different. One suspicion and one suggestion (without knowing exactly where that suggestion might lead us to). - your stdout/stderr might be connected to somewhere that your output gets stuck ("broken pipe"), when your script is run from the hook. - your environment might be different from what you are assuming. How about doing something like this? #!/bin/sh + exec >/var/tmp/hook-out.$$ 2>/var/tmp/hook-err.$$ + echo "** env **" + env + echo "** vars **" + i=0 + for v + do + echo "$i: $v" + i=$(($i+1)) + done + echo "** pwd etc **" + pwd + id -a unset GIT_DIR cd /home/barkalow/auto-working/web if ! git pull /home/barkalow/git/web.git/ and then next replace the whole thing with: exec >/dev/null 2>&1