Re: [PATCH v5 12/16] merge-recursive: flush output buffer before printing error messages
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 27, 2016, 21:53 UTC
- Message-ID
- <CAPc5daUv_csGM963pE=PD+LSSnTFZq57_Shse-x+PsJBSh0dZg@mail.gmail.com>
- In-Reply-To
- <xmqqh9bavk2x.fsf@gitster.mtv.corp.google.com>
On Wed, Jul 27, 2016 at 2:37 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
>
>> + strbuf_vaddf(&o->obuf, err, params);
>> + error("%s", o->obuf.buf);
>> + strbuf_reset(&o->obuf);
>
> Sneaky ;-)Just to avoid confusion, I am _fine_ with this "we happen to have a strbuf that we know to be empty at this point, so let's reuse it and clean after ourselves before returning".
I just found it somewhere between clever and ugly, and "sneaky" was the first word that came to my mind.