All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Clemens Buchacher <drizzd@aon.at>
Cc: "Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>,
	git@vger.kernel.org, gitster@pobox.com,
	"Jeff King" <peff@peff.net>
Subject: Re: [PATCH] git-daemon wrapper to wait until daemon is ready
Date: Sun, 15 Apr 2012 19:11:52 +0200	[thread overview]
Message-ID: <4F8B0158.4040407@kdbg.org> (raw)
In-Reply-To: <20120414220606.GA18137@ecki>

Am 15.04.2012 00:06, schrieb Clemens Buchacher:
> On Sat, Apr 14, 2012 at 09:36:38PM +0200, Johannes Sixt wrote:
>> Am 14.04.2012 20:29, schrieb Clemens Buchacher:
>>> +	memset(&cat, 0, sizeof(cat));
>>> +	cat.argv = (const char **)cat_argv;
>>> +	cat.in = proc.err;
>>> +	cat.out = 2;
>>
>> Useless use of cat?
> 
> I don't see how I could avoid cat here. I have to create a pipe first so
> that I can read the first line. And then I have to terminate
> test-git-daemon in order to start the tests. So I cannot continue
> reading synchronously.

OK, I got it.

But reading the first line in this way needs a few assumptions to be true:

- git-daemon does not write an incomplete line and then waits.

- git-daemon does not write more than one line, because xread() happily
reads everything it can get. Your implementation differs from the old
version because the shell's 'read' is required to read no more than one
line, i.e., to read byte-wise from the pipe until it sees the LF.

-- Hannes

  parent reply	other threads:[~2012-04-15 17:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-14 18:29 [PATCH] git-daemon wrapper to wait until daemon is ready Clemens Buchacher
2012-04-14 18:32 ` [PATCH] t5570: use explicit push refspec Clemens Buchacher
2012-04-14 23:40   ` Junio C Hamano
2012-04-15  0:11     ` Clemens Buchacher
2012-04-15 19:20       ` Junio C Hamano
2012-04-15 19:52         ` Clemens Buchacher
2012-04-15 20:18           ` Junio C Hamano
2012-04-14 18:43 ` [PATCH] git-daemon wrapper to wait until daemon is ready Ben Walton
2012-04-14 19:00   ` Clemens Buchacher
2012-04-14 19:16     ` [PATCH v2] " Clemens Buchacher
2012-04-14 19:36 ` [PATCH] " Johannes Sixt
2012-04-14 22:06   ` Clemens Buchacher
2012-04-15 11:53     ` [PATCH v3] " Clemens Buchacher
2012-04-16 15:46       ` Zbigniew Jędrzejewski-Szmek
2012-04-19 15:00       ` Junio C Hamano
2012-04-15 17:11     ` Johannes Sixt [this message]
2012-04-15 19:32       ` [PATCH] " Clemens Buchacher
2012-04-15 19:57         ` Johannes Sixt

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=4F8B0158.4040407@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=drizzd@aon.at \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=zbyszek@in.waw.pl \
    /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.