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

Re: [PATCH] do not pretend sha1write returns errors

From
Thomas Rast <tr@thomasrast.ch>
Date
Dec 22, 2013, 10:55 UTC
Message-ID
<87lhzdqhnb.fsf@thomasrast.ch>
In-Reply-To
<20131221141325.GA23828@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> The sha1write function returns an int, but it will always be
> "0". The failure-prone parts of the function happen in the
> "flush" callback, which cannot pass an error back to us. So
> we just end up calling die() during the flush.
>
> Let's just drop the return value altogether, as it only
> confuses callers into thinking that it might be useful.
>
> Only one call site actually checked the return value. We can
> drop that check, since it just led to a die() anyway.
>
> Signed-off-by: Jeff King <peff@peff.net>
Thanks.
> This is kind of a step backwards if we ever wanted to actually make
> sha1write's return code mean anything. But I just don't foresee that
> happening.
Meh.  It hasn't returned a useful value since its introduction in 2005.
-- 
Thomas Rast
tr@thomasrast.ch
Previous: Jeff King
Message 2 of 2 in “do not pretend sha1write returns errors”
  1. do not pretend sha1write returns errorsJeff King, Dec 21, 2013
  2. Thomas RastDec 22, 2013

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.