git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Weirdness with port-update hook and local push

From
Junio C Hamano <junkio@cox.net>
Date
Dec 5, 2005, 22:11 UTC
Message-ID
<7vk6ej9otl.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0512051651050.25300@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> 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
        
Previous: Daniel BarkalowNext: Daniel Barkalow
Message 4 of 5 in “Weirdness with port-update hook and local push”
  1. Daniel BarkalowDec 5, 2005
  2. Johannes SchindelinDec 5, 2005
  3. Daniel BarkalowDec 5, 2005
  4. Junio C HamanoDec 5, 2005
  5. Daniel BarkalowDec 6, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.