All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: hanwen@google.com, chooglen@google.com, git@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] refs: make _advance() check struct repo, not flag
Date: Thu, 16 Sep 2021 14:56:37 -0700	[thread overview]
Message-ID: <xmqqilz0rxpm.fsf@gitster.g> (raw)
In-Reply-To: <20210916172609.1074157-1-jonathantanmy@google.com> (Jonathan Tan's message of "Thu, 16 Sep 2021 10:26:09 -0700")

Jonathan Tan <jonathantanmy@google.com> writes:

>> On Wed, Sep 15, 2021 at 12:41 AM Glen Choo <chooglen@google.com> wrote:
>> > In the current state of affairs, the files ref store and the packed ref
>> > store seem to behave as a single logical ref database. An example of
>> > this (that I care about in particular) is in refs/files-backend.c where
>> > the files backend validates oids using the_repository's odb.
>> > refs/packed-backend.c doesn't do any such validation, and presumably
>> > just relies on the correctness of refs/files-backend.c. I assume that
>> > this also explains why some functions in refs_be_packed are stubs.
>> 
>> The loose/packed storage is implemented in terms of files backend (the
>> public entry point) that defers to a packed backend in some cases. The
>> latter is implemented as a ref backend, but for no good reason.
>
> Yes, the packed backend doesn't need to be a ref backend.

Sorry, I do not follow.  Do you mean we cannot have a version of Git
that offers say a read-only access to the repository without any
loose refs, with the default ref backend being the packed one?

Or do you mean that we can ignore such a hypothetical use case and
could reimplement the files backend that can also understand the
$GIT_DIR/packed-refs file directly without "deferring to another ref
backend which is 'packed'"?


  reply	other threads:[~2021-09-16 21:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 23:23 [RFC PATCH 0/2] First steps towards iterating over submodule refs Jonathan Tan
2021-08-25 23:23 ` [RFC PATCH 1/2] refs: make _advance() check struct repo, not flag Jonathan Tan
2021-08-26 16:39   ` Han-Wen Nienhuys
2021-08-26 22:24     ` Jonathan Tan
2021-09-14 22:41       ` Glen Choo
2021-09-15  7:35         ` Han-Wen Nienhuys
2021-09-16 17:26           ` Jonathan Tan
2021-09-16 21:56             ` Junio C Hamano [this message]
2021-09-16 22:05               ` Jonathan Tan
2021-09-16 17:24         ` Jonathan Tan
2021-08-25 23:23 ` [RFC PATCH 2/2] refs: add repo paramater to _iterator_peel() Jonathan Tan

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=xmqqilz0rxpm.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=chooglen@google.com \
    --cc=git@vger.kernel.org \
    --cc=hanwen@google.com \
    --cc=jonathantanmy@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.