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

Re: [PATCH] strbuf: describe the return value of strbuf_read_file()

From
Pranit Bauva <pranit.bauva@gmail.com>
Date
Jun 14, 2016, 05:57 UTC
Message-ID
<CAFZEwPPd_+9nFPCG51nr5s1XMs5SKXG3O3vbAZmxA-BHvZdFPg@mail.gmail.com>
In-Reply-To
<xmqqfusgbv0e.fsf@gitster.mtv.corp.google.com>
Hey Junio,
On Tue, Jun 14, 2016 at 3:40 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
>> It is easy to be misguided on the return value of the function
>> strbuf_read_file(). It does follow the pattern of other standard functions
>> for reading files but its better to explicitly specify it.
>
> Good thing to do; I wonder if we want to explicitly say -1 or
> leave it at "negative values are errors", though (my knee-jerk
> reaction being "do not over-specify more than absolute minimum
> to write callers correctly").
Sure I will re-roll with specifying about negative values as errors.

Regards, Pranit Bauva

Previous: Junio C Hamano
Message 3 of 3 in “strbuf: describe the return value of strbuf_read_file()”
  1. strbuf: describe the return value of strbuf_read_file()Pranit Bauva, Jun 13, 2016
  2. Junio C HamanoJun 13, 2016
  3. Pranit BauvaJun 14, 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.