git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Han-Wen Nienhuys <hanwen@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Han-Wen Nienhuys via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Han-Wen Nienhuys <hanwenn@gmail.com>
Subject: Re: [PATCH 2/2] refs: set the repo in debug_ref_store.base
Date: Wed, 22 Dec 2021 19:13:11 +0100	[thread overview]
Message-ID: <CAFQ2z_M7S_gC2AfuPZptYAY3E2XmUMhQONq5iv90OJZHXWrq-Q@mail.gmail.com> (raw)
In-Reply-To: <xmqqtuf1kwob.fsf@gitster.g>

On Wed, Dec 22, 2021 at 6:58 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> "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

  reply	other threads:[~2021-12-22 18:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 12:33 [PATCH 0/2] tweaks to refs/debug.c Han-Wen Nienhuys via GitGitGadget
2021-12-21 12:33 ` [PATCH 1/2] refs: print error message in debug output Han-Wen Nienhuys via GitGitGadget
2021-12-21 12:33 ` [PATCH 2/2] refs: set the repo in debug_ref_store.base Han-Wen Nienhuys via GitGitGadget
2021-12-22  5:58   ` Junio C Hamano
2021-12-22 18:13     ` Han-Wen Nienhuys [this message]
2021-12-22 18:11 ` [PATCH v2 0/3] tweaks to refs/debug.c Han-Wen Nienhuys via GitGitGadget
2021-12-22 18:11   ` [PATCH v2 1/3] refs: pass gitdir to packed_ref_store_create Han-Wen Nienhuys via GitGitGadget
2021-12-22 18:11   ` [PATCH v2 2/3] refs: print error message in debug output Han-Wen Nienhuys via GitGitGadget
2021-12-22 18:11   ` [PATCH v2 3/3] refs: centralize initialization of the base ref_store Han-Wen Nienhuys via GitGitGadget
2021-12-22 21:54   ` [PATCH v2 0/3] tweaks to refs/debug.c Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFQ2z_M7S_gC2AfuPZptYAY3E2XmUMhQONq5iv90OJZHXWrq-Q@mail.gmail.com \
    --to=hanwen@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=hanwenn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).