git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* weird fatal on push when post-receive hook exists but is empty
@ 2010-04-20 16:21 Sitaram Chamarty
  2010-04-21  8:46 ` Michael J Gruber
  0 siblings, 1 reply; 3+ messages in thread
From: Sitaram Chamarty @ 2010-04-20 16:21 UTC (permalink / raw)
  To: Git Mailing List

Helping someone with what at first appeared to be a gitolite problem,
we found something curious.  Here it is, reduced to pure git, even
without ssh and other complications in between:

    21:47:05 sita-lt:t $ rm -rf a b c
    21:47:10 sita-lt:t $ git init --bare b
    Initialized empty Git repository in /home/sitaram/t/b/
    21:47:23 sita-lt:t $ git clone b a
    Initialized empty Git repository in /home/sitaram/t/a/.git/
    warning: You appear to have cloned an empty repository.
    21:47:29 sita-lt:t $ cat > b/hooks/post-receive
    #!/bin/bash
    # dummy
    21:47:55 sita-lt:t $ chmod +x b/hooks/post-receive
    21:48:00 sita-lt:t $ cd a
    21:48:02 sita-lt:a (master) $ date > foo;git add foo; git commit
-m foo; git push origin master
    [master (root-commit) f55bd25] foo
     1 files changed, 1 insertions(+), 0 deletions(-)
     create mode 100644 foo
    Counting objects: 3, done.
    Writing objects: 100% (3/3), 232 bytes, done.
    Total 3 (delta 0), reused 0 (delta 0)
    Unpacking objects: 100% (3/3), done.
    fatal: The remote end hung up unexpectedly
    error: error in sideband demultiplexer
    error: .git/objects/f5/5bd251325ad1647a29869e75a8080fee1a5d97 died
of signal 13
    To /home/sitaram/t/b
     * [new branch]      master -> master
    error: failed to push some refs to '/home/sitaram/t/b'
    (rc=1)21:48:23 sita-lt:a $

Of course, this does not happen when the hook doesn't even exist...

-- 
Sitaram

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: weird fatal on push when post-receive hook exists but is empty
  2010-04-20 16:21 weird fatal on push when post-receive hook exists but is empty Sitaram Chamarty
@ 2010-04-21  8:46 ` Michael J Gruber
  2010-04-21  9:28   ` Johannes Sixt
  0 siblings, 1 reply; 3+ messages in thread
From: Michael J Gruber @ 2010-04-21  8:46 UTC (permalink / raw)
  To: Sitaram Chamarty; +Cc: Git Mailing List

Sitaram Chamarty venit, vidit, dixit 20.04.2010 18:21:
> 21:47:05 sita-lt:t $ rm -rf a b c
>     21:47:10 sita-lt:t $ git init --bare b
>     Initialized empty Git repository in /home/sitaram/t/b/
>     21:47:23 sita-lt:t $ git clone b a
>     Initialized empty Git repository in /home/sitaram/t/a/.git/
>     warning: You appear to have cloned an empty repository.
>     21:47:29 sita-lt:t $ cat > b/hooks/post-receive
>     #!/bin/bash
>     # dummy
>     21:47:55 sita-lt:t $ chmod +x b/hooks/post-receive
>     21:48:00 sita-lt:t $ cd a
>     21:48:02 sita-lt:a (master) $ date > foo;git add foo; git commit
> -m foo; git push origin master
>     [master (root-commit) f55bd25] foo
>      1 files changed, 1 insertions(+), 0 deletions(-)
>      create mode 100644 foo
>     Counting objects: 3, done.
>     Writing objects: 100% (3/3), 232 bytes, done.
>     Total 3 (delta 0), reused 0 (delta 0)
>     Unpacking objects: 100% (3/3), done.
>     fatal: The remote end hung up unexpectedly
>     error: error in sideband demultiplexer
>     error: .git/objects/f5/5bd251325ad1647a29869e75a8080fee1a5d97 died
> of signal 13
>     To /home/sitaram/t/b
>      * [new branch]      master -> master
>     error: failed to push some refs to '/home/sitaram/t/b'
>     (rc=1)21:48:23 sita-lt:a $

With git version 1.7.1.rc1.248.gcefbb and this script:

#!/bin/bash
rm -rf a b c
git init --bare b
git clone b a
cat > b/hooks/post-receive <<EOF
#!/bin/bash
# dummy
EOF
chmod +x b/hooks/post-receive
cd a
date > foo;git add foo; git commit -m foo; git push origin master

I get this output:
Initialized empty Git repository in /tmp/t/b/
Initialized empty Git repository in /tmp/t/a/.git/
warning: You appear to have cloned an empty repository.
[master (root-commit) 020a1fb] foo
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 foo
Counting objects: 3, done.
Writing objects: 100% (3/3), 241 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To /tmp/t/b
 * [new branch]      master -> master

What are we doing differently?

Michael

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: weird fatal on push when post-receive hook exists but is empty
  2010-04-21  8:46 ` Michael J Gruber
@ 2010-04-21  9:28   ` Johannes Sixt
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Sixt @ 2010-04-21  9:28 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: Sitaram Chamarty, Git Mailing List

Am 4/21/2010 10:46, schrieb Michael J Gruber:
> What are we doing differently?

Your box has a different scheduler. I doesn't run (or exit) the script
soon enough that the parent (receive-pack) can get SIGPIPE when it writes
refs to the script's stdin.

-- Hannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-21  9:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-20 16:21 weird fatal on push when post-receive hook exists but is empty Sitaram Chamarty
2010-04-21  8:46 ` Michael J Gruber
2010-04-21  9:28   ` Johannes Sixt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).