Fwd: [PATCH] RFC: refs: add GIT_DEBUG_REFS debugging mechanism
From: Han-Wen Nienhuys <hidden>
Date: 2020-09-03 10:10:58
On Thu, Sep 3, 2020 at 8:19 AM Jeff King [off-list ref] wrote:
quoted
- 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 APIYeah, from my look at the debug patch, this seems sensible.
thanks, I'll rework it to use the traditional trace API.
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.