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

Fwd: [PATCH] RFC: refs: add GIT_DEBUG_REFS debugging mechanism

From
Han-Wen Nienhuys <hanwen@google.com>
Date
Sep 3, 2020, 10:10 UTC
Message-ID
<CAFQ2z_P9dRKX-O3MGFWj1TaYciCLHBboP0jAvROYyn5QaPngYw@mail.gmail.com>
In-Reply-To
<CAFQ2z_M_2mmL1LXcgR5cv3Ac1AJ363jaejZz3p6AcV6b3DftTQ@mail.gmail.com>
On Thu, Sep 3, 2020 at 8:19 AM Jeff King <peff@peff.net> wrote:
Show 6 quoted lines
>
> > - if this is only going to be used for tests and for ad hoc debugging,
> >   I'd suggest sticking to the simple trace_key based unstructured
> >   tracing API
>
> Yeah, from my look at the debug patch, this seems sensible.
thanks, I'll rework it to use the traditional trace API.
Show 6 quoted lines
> As clever as the "debug" ref-backend wrapper object is, I also wonder if
> it might be simpler to just add trace calls to all of the outer
> functions (e.g., ref_transaction_prepare(), etc). Unlike a "real" OO
> system, we're not typically passing around the polymorphic ref_store
> type, but always access it through those type-agnostic wrappers. But
> maybe that would end up just as long. I dunno.

The ref backend supports callbacks, so it will always require some amount of wrapping. The advantage of this approach is that the debug support stays very neatly separate from the actual logic, and that the compiler enforces that we add debug support if a new ref backend method is added.

-- 
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



-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
Previous: Han-Wen Nienhuys via GitGitGadget
Message 10 of 10 in “RFC: refs: add GIT_DEBUG_REFS debugging mechanism”
  1. RFC: refs: add GIT_DEBUG_REFS debugging mechanismHan-Wen Nienhuys via GitGitGadget, Aug 28, 2020
  2. Jonathan TanSep 2, 2020
  3. Jonathan NiederSep 3, 2020
  4. Jeff KingSep 3, 2020
  5. refs: add GIT_TRACE_REFS debugging mechanismHan-Wen Nienhuys via GitGitGadget, Sep 7, 2020
  6. Junio C HamanoSep 8, 2020
  7. Han-Wen NienhuysSep 9, 2020
  8. refs: add GIT_TRACE_REFS debugging mechanismHan-Wen Nienhuys via GitGitGadget, Sep 9, 2020
  9. refs: add GIT_TRACE_REFS debugging mechanismHan-Wen Nienhuys via GitGitGadget, Sep 16, 2020
  10. Fwd: [PATCH] RFC: refs: add GIT_DEBUG_REFS debugging mechanismHan-Wen Nienhuys, Sep 3, 2020

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.