Re: [PATCH v7 03/10] pkt-line: add packet_write_fmt_gently()

2016-09-12 Thread Lars Schneider
> On 11 Sep 2016, at 18:01, Stefan Beller wrote: > > On Sun, Sep 11, 2016 at 4:36 AM, Lars Schneider > wrote: > >>> >>> call check_pipe from write_or_die here instead of >>> reproducing that function? >> [...] > >> Maybe it would be more suitable to move check_pipe to >> run-command.h/c?

Re: [PATCH v7 03/10] pkt-line: add packet_write_fmt_gently()

2016-09-11 Thread Stefan Beller
On Sun, Sep 11, 2016 at 4:36 AM, Lars Schneider wrote: >> >>call check_pipe from write_or_die here instead of >>reproducing that function? > > Yes, might be better. I wasn't sure because the check_pipe is > not public. > > Where would you declare check_pipe? In cache.h? IIRC, once upon a

Re: [PATCH v7 03/10] pkt-line: add packet_write_fmt_gently()

2016-09-11 Thread Lars Schneider
> On 08 Sep 2016, at 23:18, Stefan Beller wrote: > > On Thu, Sep 8, 2016 at 11:21 AM, wrote: > >> +static int packet_write_fmt_1(int fd, int gently, >> + const char *fmt, va_list args) >> +{ >> + struct strbuf buf = STRBUF_INIT; >> + size_t count; >> +

Re: [PATCH v7 03/10] pkt-line: add packet_write_fmt_gently()

2016-09-08 Thread Stefan Beller
On Thu, Sep 8, 2016 at 11:21 AM, wrote: > +static int packet_write_fmt_1(int fd, int gently, > + const char *fmt, va_list args) > +{ > + struct strbuf buf = STRBUF_INIT; > + size_t count; > + > + format_packet(&buf, fmt, args); > + count = wri

[PATCH v7 03/10] pkt-line: add packet_write_fmt_gently()

2016-09-08 Thread larsxschneider
From: Lars Schneider packet_write_fmt() would die in case of a write error even though for some callers an error would be acceptable. Add packet_write_fmt_gently() which writes a formatted pkt-line and returns `0` for success and `-1` for an error. Signed-off-by: Lars Schneider --- pkt-line.c