From: Johannes Schindelin Date: Mon, 12 Feb 2024 23:16:28 GMT Subject: Re: [PATCH] Always check the return value of `repo_read_object_file()` Message-ID: <805cc537-a567-e261-860c-5aba826b9e0e@gmx.de> In-Reply-To: Hi Karthik, On Mon, 5 Feb 2024, Karthik Nayak wrote: > Hello, > > "Johannes Schindelin via GitGitGadget" writes: > > diff --git a/bisect.c b/bisect.c > > index f1273c787d9..f75e50c3397 100644 > > --- a/bisect.c > > +++ b/bisect.c > > @@ -158,6 +158,9 @@ static void show_list(const char *debug, int counted, int nr, > > const char *subject_start; > > int subject_len; > > > > + if (!buf) > > + die(_("unable to read %s"), oid_to_hex(&commit->object.oid)); > > + > > Nit: We know that `repo_read_object_file()` fails on corrupt objects, so > this means that this is only happening when the object doesn't exist. I > wonder if it makes more sense to replace "unable to read %s" which is a > little ambiguous with something like "object %q doesn't exist". I specifically copied this error message from existing code that already deals with these errors, so as not to cause unnecessary translator friction. Ciao, Johannes