From: Thomas Rast <trast@inf.ethz.ch>
To: Tamas Csabina <tcsabina@gmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: slow process of post-receive script on a remote (samba) share
Date: Thu, 13 Jun 2013 14:19:57 +0200 [thread overview]
Message-ID: <87li6eqk2a.fsf@linux-k42r.v.cablecom.net> (raw)
In-Reply-To: <CAH+Cn14TLpR1KT+3GND2Zmb8tDmFBP7AWpyrT7nVeMFw6V7FGA@mail.gmail.com> (Tamas Csabina's message of "Thu, 13 Jun 2013 11:18:32 +0200")
Tamas Csabina <tcsabina@gmail.com> writes:
> I am using Git bash from version 1.8.3.msysgit.0, on a Windows 7x64 PC.
> I have an issue with executing git push if I have a post-receive
> script configured.
> The content of the script is not really important, as if I have a
> script that contains only commented out lines (around 70 lines), my
> git push command is delayed with around 5 seconds.
>
>
> I`ve tested the script on another PC and it is working fine. No delay
> at all. So there are some issues on my PC regarding how git processes
> remote scripts.
>
> I took a wireshark trace with 2 scenarios on my PC:
>
> 1. just execute `cat <path_to_the_script>\post-receive` command in the git bash
> 2. did a `real` git push
>
> Results of the wireshark traces shows:
>
> 1. Read AndX Request, FID: 0x228f, 1024 bytes at offset 0 (1024 bytes
> at time, always)
> 2. Read AndX Request, FID: 0x21c9, 1 byte at offset 0 (1 byte, always)
>
> Conclusion:
> git push command reads the post-receive script in 1 byte chunks, which
> dramatically slows down the execution process.
git doesn't read the script; the interpreter does. In the case of a
script, the interpreter is specified in the #! line at the top; in the
case of a binary executable, it is specified within the executable (and
for linux, is usually /lib/ld-linux.so.2).
Exactly the same should happen if you run the hook manually, so you can
try that to debug it.
Note also that Weird Things(tm) relating to SIGPIPE may happen if you
don't read your input. Even if you are only fooling around for testing,
a post-receive hook must consume its input, e.g., by discarding it with
'cat >/dev/null'.
--
Thomas Rast
trast@{inf,student}.ethz.ch
next prev parent reply other threads:[~2013-06-13 12:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 9:18 slow process of post-receive script on a remote (samba) share Tamas Csabina
2013-06-13 12:19 ` Thomas Rast [this message]
2013-06-13 13:47 ` Tamas Csabina
2013-06-13 14:29 ` Thomas Rast
2013-06-14 13:06 ` Tamas Csabina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87li6eqk2a.fsf@linux-k42r.v.cablecom.net \
--to=trast@inf.ethz.ch \
--cc=git@vger.kernel.org \
--cc=tcsabina@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.