On Sun, Apr 15, 2012 at 07:11:52PM +0200, Johannes Sixt wrote: > > 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. Yes. One way to avoid that assumption would be a timeout. > - 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. The strbuf_getwholeline_fd implementation calls xread(fd, buf, 1), reading only one byte at a time. It does not try to read beyond the newline. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html