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

Re: Re* diff: --quiet does not imply --exit-code if --diff-filter is present

From
Jeff King <peff@peff.net>
Date
May 31, 2011, 17:14 UTC
Message-ID
<20110531171401.GA12466@sigill.intra.peff.net>
In-Reply-To
<7vd3iykdej.fsf_-_@alter.siamese.dyndns.org>
On Tue, May 31, 2011 at 10:06:44AM -0700, Junio C Hamano wrote:
Show 5 quoted lines
> Add "exiting_early" field to unpack_trees_options structure, to signal the
> unpack_trees() machinery that the negative return value is not signaling
> an error but an early return from the unpack_trees() machinery. As this by
> definition hasn't unpacked everything, discard the resulting index just
> like the failure codepath.

Maybe it is just me, but I would think that it's a little more intuitive to set exiting_early and then return "0" to indicate "success, but I didn't look at everything".

I guess you did it this way to better share the discard-the-result codepath. Maybe it wouldn't be too painful to refactor unpack_failed() into the failed bits plus a call to a new unpack_discard() that does the non-error bits. It may not be worth the trouble though.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 8 in “diff: --quiet does not imply --exit-code if --diff-filter is present”
  1. Yasushi SHOJIMay 31, 2011
  2. Jeff KingMay 31, 2011
  3. Junio C HamanoMay 31, 2011
  4. Jeff KingMay 31, 2011
  5. Re* diff: --quiet does not imply --exit-code if --diff-filter is presentJunio C Hamano, May 31, 2011
  6. Jeff KingMay 31, 2011
  7. Junio C HamanoMay 31, 2011
  8. Yasushi SHOJIJun 1, 2011

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.