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

Re: [PATCH] pretend_sha1_file(): Change return type from int to void

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 7, 2015, 17:36 UTC
Message-ID
<xmqqfv1mvawu.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<ef5b20ed42ea20b2891fc3998a81f339@dscho.org>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 7 quoted lines
> As to the patch, I cannot speak for Junio, of course, but my
> preference would be to keep the return type. Traditionally, functions
> that can fail either die() or return an int; non-zero indicates an
> error. In this case, it seems that we do not have any condition
> (yet...) under which an error could occur. It does not seem very
> unlikely that we may eventually have such conditions, though, hence my
> preference.

Accepting Tobias's patch may have a documentation value to let the callers know that the function does not give the caller any error diagnosis, and it may matter a lot if this were a very frequently used function, but that is not exactly the case here.

I do not care too deeply.
Previous: Tobias KlauserNext: Stefan Beller
Message 6 of 12 in “pretend_sha1_file(): Change return type from int to void”
  1. pretend_sha1_file(): Change return type from int to voidTobias Klauser, Oct 6, 2015
  2. Johannes SchindelinOct 6, 2015
  3. Tobias KlauserOct 6, 2015
  4. Johannes SchindelinOct 6, 2015
  5. Tobias KlauserOct 7, 2015
  6. Junio C HamanoOct 7, 2015
  7. Stefan BellerOct 7, 2015
  8. Junio C HamanoOct 7, 2015
  9. Stefan BellerOct 7, 2015
  10. Junio C HamanoOct 7, 2015
  11. Junio C HamanoOct 7, 2015
  12. Tobias KlauserOct 8, 2015

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.