git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Remove obsolete comment from color.h

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 28, 2016, 16:36 UTC
Message-ID
<CAPc5daXVxNtx1HTYBToSds92X37Ns4yd3w2hxH08ocJLre8LrA@mail.gmail.com>
In-Reply-To
<alpine.DEB.2.20.1606281822240.12947@virtualbox>

On Tue, Jun 28, 2016 at 9:24 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 11 quoted lines
>
> On Tue, 28 Jun 2016, Junio C Hamano wrote:
>>
>> So as long as we write via stdio to stdout/stderr, you can show
>> colors?  Or is it now stronger, in that as long as we do anything
>> that ends up writing to file descriptors 1 or 2, you can show
>> colors?
>
> Essentially, the caveat in color.h that one should use fprintf() and
> printf() when outputting color sequences to a terminal no longer holds
> true. fwrite() or write() work just as well.

In short, the answer is "the latter"? That is a great news. It means that Lukas can use write(2) in the recv_sideband() patch to ensure atomicity, without having to rely on the observed behaviour of fprintf(stderr, "%s", ...) that as long as the output is within reasonable size the call seems to result in a single write(2).

Thanks for a clarification.
Previous: Johannes SchindelinNext: Jeff King
Message 4 of 5 in “Remove obsolete comment from color.h”
  1. Remove obsolete comment from color.hJohannes Schindelin, Jun 28, 2016
  2. Junio C HamanoJun 28, 2016
  3. Johannes SchindelinJun 28, 2016
  4. Junio C HamanoJun 28, 2016
  5. Jeff KingJun 28, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.