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

Re: [PATCH 2/2] refs: set the repo in debug_ref_store.base

From
Han-Wen Nienhuys <hanwen@google.com>
Date
Dec 22, 2021, 18:13 UTC
Message-ID
<CAFQ2z_M7S_gC2AfuPZptYAY3E2XmUMhQONq5iv90OJZHXWrq-Q@mail.gmail.com>
In-Reply-To
<xmqqtuf1kwob.fsf@gitster.g>
On Wed, Dec 22, 2021 at 6:58 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
>
> "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: Han-Wen Nienhuys <hanwen@google.com>
> >
> > This is for consistency with the files backend.
>
> Hmmmm.  Could you explain what it exactly means?
>
> I can see that files_ref_store structure has the .repo member and
> files_ref_store_create() uses it to remember which repository the
> ref store is for, but that is an implementation detail that is not
> exposed outside the files backend, isn't it?
>
> To put it differently, what is broken with the current code that
> leaves the .repo member in refs->base uninitialized?  We are
> presumably helping the caller that wants to know the repository the
> ref store belongs to via this pointer with this change---what is
> that caller?

It's confusing for the base ref_store to have fields that are sometimes set and sometimes not. I sent an alternate take on this as v2; hope you like that better.

(sorry, I forgot to update the cover letter.)
-- 
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: Junio C HamanoNext: Han-Wen Nienhuys via GitGitGadget
Message 5 of 10 in “tweaks to refs/debug.c”
  1. 0/2 tweaks to refs/debug.cHan-Wen Nienhuys via GitGitGadget, Dec 21, 2021
  2. 1/2 refs: print error message in debug outputHan-Wen Nienhuys via GitGitGadget, Dec 21, 2021
  3. 2/2 refs: set the repo in debug_ref_store.baseHan-Wen Nienhuys via GitGitGadget, Dec 21, 2021
  4. Junio C HamanoDec 22, 2021
  5. Han-Wen NienhuysDec 22, 2021
  6. 0/3 tweaks to refs/debug.cHan-Wen Nienhuys via GitGitGadget, Dec 22, 2021
  7. 1/3 refs: pass gitdir to packed_ref_store_createHan-Wen Nienhuys via GitGitGadget, Dec 22, 2021
  8. 2/3 refs: print error message in debug outputHan-Wen Nienhuys via GitGitGadget, Dec 22, 2021
  9. 3/3 refs: centralize initialization of the base ref_store.Han-Wen Nienhuys via GitGitGadget, Dec 22, 2021
  10. Junio C HamanoDec 22, 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.