From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] usage: try harder to format very long error messages
Date: Tue, 11 Aug 2015 09:34:31 -0700 [thread overview]
Message-ID: <xmqqtws5ss14.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150811161752.GA14829@sigill.intra.peff.net> (Jeff King's message of "Tue, 11 Aug 2015 12:17:53 -0400")
Jeff King <peff@peff.net> writes:
> We use a fixed-size buffer of 4096 bytes to format die() and
> error() messages. We explicitly avoided using a strbuf or
> other fanciness here, because we want to make sure that we
> report the message even in the face of malloc() failure
> (after all, we might even be dying due to a malloc call).
Yes, that was the rationale behind the "we use a fixed-buffer and
try not to allocate in this codepath", I think.
> As for vwritef, it exists solely to work over write(), _and_ it doesn't
> get the "one-shot" thing right (which is probably OK, as we use it only
> when exec fails). But we could probably teach run-command to fdopen(),
> and get rid of it entirely (in favor of teaching vreportf to take a
> FILE* handle instead of assuming stderr).
Sounds like a plan ;-)
The patch looks very sensible.
next prev parent reply other threads:[~2015-08-11 16:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-11 16:17 [PATCH] usage: try harder to format very long error messages Jeff King
2015-08-11 16:28 ` Stefan Beller
2015-08-11 16:33 ` Jeff King
2015-08-11 16:34 ` Junio C Hamano [this message]
2015-08-11 18:05 ` Jeff King
2015-08-11 18:06 ` [PATCH 1/2] vreportf: report to arbitrary filehandles Jeff King
2015-08-11 18:13 ` [PATCH 2/2] vreportf: avoid intermediate buffer Jeff King
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=xmqqtws5ss14.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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.