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

Re: [PATCH] refs: print errno for read_raw_ref if GIT_TRACE_REFS is set

From
Han-Wen Nienhuys <hanwen@google.com>
Date
Apr 13, 2021, 12:02 UTC
Message-ID
<CAFQ2z_OMUdi4D3Jg3rsPr_Q-VeRptdiEOiYOL2kmyuBuvZLCjg@mail.gmail.com>
In-Reply-To
<CAFQ2z_MnZOfo4Bt6SsRJnL+F70r9wr_jYSf2KGvcvyX-8PfVRQ@mail.gmail.com>
On Tue, Apr 13, 2021 at 1:58 PM Han-Wen Nienhuys <hanwen@google.com> wrote:
Show 17 quoted lines
>
> On Mon, Apr 12, 2021 at 11:45 PM Junio C Hamano <gitster@pobox.com> wrote:
> > > @@ -251,7 +252,9 @@ static int debug_read_raw_ref(struct ref_store *ref_store, const char *refname,
> > >               trace_printf_key(&trace_refs, "read_raw_ref: %s: %s (=> %s) type %x: %d\n",
> > >                       refname, oid_to_hex(oid), referent->buf, *type, res);
> > >       } else {
> > > -             trace_printf_key(&trace_refs, "read_raw_ref: %s: %d\n", refname, res);
> > > +             trace_printf_key(&trace_refs,
> > > +                              "read_raw_ref: %s: %d (errno %d)\n", refname,
> > > +                              res, errno);
> > >       }
> >
> > OK.  Between trace_printf_key() and the return of the call to
> > read_raw_ref() method of the ref backend is only an "if (res == 0)"
> > condition and I do not see anything that might clobber errno.
>
> I don't want to bet on that. Let me send a second round.
oh, ugh.  In email, there are two calls, but one is prefixed with '-'.
Nevertheless, a bit of paranoia doesn't hurt here.
-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Previous: Han-Wen NienhuysNext: Junio C Hamano
Message 4 of 7 in “refs: print errno for read_raw_ref if GIT_TRACE_REFS is set”
  1. refs: print errno for read_raw_ref if GIT_TRACE_REFS is setHan-Wen Nienhuys via GitGitGadget, Apr 12, 2021
  2. Junio C HamanoApr 12, 2021
  3. Han-Wen NienhuysApr 13, 2021
  4. Han-Wen NienhuysApr 13, 2021
  5. Junio C HamanoApr 13, 2021
  6. Han-Wen NienhuysApr 23, 2021
  7. refs: print errno for read_raw_ref if GIT_TRACE_REFS is setHan-Wen Nienhuys via GitGitGadget, Apr 13, 2021

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.