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

Re: [RFC PATCH 1/2] refs: make _advance() check struct repo, not flag

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 16, 2021, 21:56 UTC
Message-ID
<xmqqilz0rxpm.fsf@gitster.g>
In-Reply-To
<20210916172609.1074157-1-jonathantanmy@google.com>
Jonathan Tan <jonathantanmy@google.com> writes:
Show 14 quoted lines
>> 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'"?

Previous: Jonathan TanNext: Jonathan Tan
Message 8 of 11 in “First steps towards iterating over submodule refs”
  1. 0/2 First steps towards iterating over submodule refsJonathan Tan, Aug 25, 2021
  2. 1/2 refs: make _advance() check struct repo, not flagJonathan Tan, Aug 25, 2021
  3. Han-Wen NienhuysAug 26, 2021
  4. Jonathan TanAug 26, 2021
  5. Glen ChooSep 14, 2021
  6. Han-Wen NienhuysSep 15, 2021
  7. Jonathan TanSep 16, 2021
  8. Junio C HamanoSep 16, 2021
  9. Jonathan TanSep 16, 2021
  10. Jonathan TanSep 16, 2021
  11. 2/2 refs: add repo paramater to _iterator_peel()Jonathan Tan, Aug 25, 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.