From: Daniel Barkalow <barkalow@iabervon.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/8] Use a clearer style to issue commands to remote helpers
Date: Sun, 9 Aug 2009 17:14:04 -0400 (EDT) [thread overview]
Message-ID: <alpine.LNX.2.00.0908091617310.27553@iabervon.org> (raw)
In-Reply-To: <alpine.DEB.1.00.0908092211030.8306@pacific.mpi-cbg.de>
On Sun, 9 Aug 2009, Johannes Schindelin wrote:
> > + strbuf_addstr(&buf, "capabilities\n");
> > + write_in_full(helper->in, buf.buf, buf.len);
> > + strbuf_reset(&buf);
>
> Hmm. I think you use the same paradigm three times. Maybe it is time to
> heed the DRY principle and introduce a helper function?
>
> Maybe something like
>
> void fprintf_in_full(struct strbuf *buf, int fd, const char *format, ...)
> {
> va_list ap;
>
> va_start(ap, format);
> strbuf_reset(buf);
> strbuf_vaddf(buf, format, ap);
> write_in_full(fd, buf->buf, buf->len);
> va_end(ap);
> }
>
> But I keep forgetting that there is no strbuf_vaddf() in 'next'... maybe
> it is high time that I forget my promise and re-submit that series?
Yup, that's exactly what I started writing, until I ran into the lack of
strbuf_vaddf() and remembered that there were portability issues I don't
understand with copying va_lists.
-Daniel
*This .sig left intentionally blank*
prev parent reply other threads:[~2009-08-09 21:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-09 19:28 [PATCH 1/8] Use a clearer style to issue commands to remote helpers Daniel Barkalow
2009-08-09 20:17 ` Johannes Schindelin
2009-08-09 21:14 ` Daniel Barkalow [this message]
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=alpine.LNX.2.00.0908091617310.27553@iabervon.org \
--to=barkalow@iabervon.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox