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

Re: [PATCH] git-daemon wrapper to wait until daemon is ready

From
Johannes Sixt <j6t@kdbg.org>
Date
Apr 15, 2012, 17:11 UTC
Message-ID
<4F8B0158.4040407@kdbg.org>
In-Reply-To
<20120414220606.GA18137@ecki>
Am 15.04.2012 00:06, schrieb Clemens Buchacher:
Show 13 quoted lines
> 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
Previous: Junio C HamanoNext: Clemens Buchacher
Message 16 of 18 in “git-daemon wrapper to wait until daemon is ready”
  1. git-daemon wrapper to wait until daemon is readyClemens Buchacher, Apr 14, 2012
  2. t5570: use explicit push refspecClemens Buchacher, Apr 14, 2012
  3. Junio C HamanoApr 14, 2012
  4. Clemens BuchacherApr 15, 2012
  5. Junio C HamanoApr 15, 2012
  6. Clemens BuchacherApr 15, 2012
  7. Junio C HamanoApr 15, 2012
  8. Ben WaltonApr 14, 2012
  9. Clemens BuchacherApr 14, 2012
  10. git-daemon wrapper to wait until daemon is readyClemens Buchacher, Apr 14, 2012
  11. Johannes SixtApr 14, 2012
  12. Clemens BuchacherApr 14, 2012
  13. git-daemon wrapper to wait until daemon is readyClemens Buchacher, Apr 15, 2012
  14. Zbigniew Jędrzejewski-SzmekApr 16, 2012
  15. Junio C HamanoApr 19, 2012
  16. Johannes SixtApr 15, 2012
  17. Clemens BuchacherApr 15, 2012
  18. Johannes SixtApr 15, 2012

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.