git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org, Josh Steadmon <steadmon@google.com>,
	Jeff Hostetler <jeffhost@microsoft.com>
Subject: Re: RFC: error codes on exit
Date: Fri, 21 May 2021 05:43:18 -0400	[thread overview]
Message-ID: <YKeAtj7wwW0Qskm+@coredump.intra.peff.net> (raw)
In-Reply-To: <YKaguiSjewjpvOj5@google.com>

On Thu, May 20, 2021 at 10:47:38AM -0700, Jonathan Nieder wrote:

> >                 And that gets very daunting to think about annotating
> > and communicating about each such case (we don't even pass that level of
> > detailed information inside the program in a machine-readable way;
> > scraping stderr is the best way to figure this stuff out now).
> 
> This feels like good news to me: it sounds like if we add
> application-specific codes like MISSING_OBJECT to Git, then it would
> be useful to both of us.

Perhaps. I think the context matters between "missing an object from the
command line" and "missing an object I expected to find while
traversing". And I'm not sure all spots which look up an object will
know that context.

In some sense that's "just" a programming problem; surfacing the errors
to the right spot that can decide how to exit. But I worry a bit that
it's fighting uphill against the current code structure. There's
probably going to be a period where MISSING_OBJECT versus UNKNOWN is
wildly inaccurate, and a long tail of cases to fix.

Erring to say "UNKNOWN" is probably OK for most callers (they are happy
to learn of a specific error and act on it appropriately, but if Git
can't tell it to them, they have a generic path). But erring in the
other direction might be bad (you fail to realize a repo is corrupt, and
instead attribute it to caller error).

So again, I return "I dunno". Something of this magnitude probably has
to be done incrementally and over time. But I'd be loathe to trust it
and convert existing callers use it for a while. And that creates a
chicken-and-egg problem for finding the places which need improvement.

-Peff

  reply	other threads:[~2021-05-21  9:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 23:34 RFC: error codes on exit Jonathan Nieder
2021-05-20  0:40 ` Felipe Contreras
2021-05-21 16:53   ` Alex Henrie
2021-05-21 23:20     ` H. Peter Anvin
2021-05-22  4:06       ` Bagas Sanjaya
2021-05-22  8:49       ` Junio C Hamano
2021-05-22  9:08         ` H. Peter Anvin
2021-05-22 21:22         ` Felipe Contreras
2021-05-22 21:29           ` H. Peter Anvin
2021-05-22 21:53             ` Felipe Contreras
2021-05-22 23:02               ` H. Peter Anvin
2021-05-22  9:12     ` Philip Oakley
2021-05-22 21:19       ` Felipe Contreras
2021-05-25 17:24         ` Alex Henrie
2021-05-25 18:43           ` Felipe Contreras
2021-05-20  0:49 ` Junio C Hamano
2021-05-20  1:19   ` Felipe Contreras
2021-05-20  1:55   ` Jonathan Nieder
2021-05-20  2:28     ` Junio C Hamano
2021-05-20 13:28 ` Jeff King
2021-05-20 17:47   ` Jonathan Nieder
2021-05-21  9:43     ` Jeff King [this message]
2021-05-20 15:09 ` Jeff Hostetler
2021-05-21  1:33   ` brian m. carlson
2021-05-21  1:20 ` brian m. carlson
2021-05-26  8:21 ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YKeAtj7wwW0Qskm+@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jeffhost@microsoft.com \
    --cc=jrnieder@gmail.com \
    --cc=steadmon@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).