Subject: Re: [PATCH v2] doc: add a explanation of Git's data model

From: Junio C Hamano <[email-masked]>
Date: Mon, 13 Oct 2025 07:48:15 -0700

Patrick Steinhardt <[email-masked]> writes:

> On Wed, Oct 08, 2025 at 01:53:41PM +0000, Julia Evans via GitGitGadget wrote:
> [snip]
>> +[[blob]]
>> +blobs::
>> +    A blob is how Git represents a file. A blob object contains the
>> +    file's contents.
>> ++
>> +
>> +NOTE: Storing a new blob for every new version of a file can use a
>> +lot of disk space. To handle this, Git periodically runs repository
>> +maintenance with linkgit:git-gc[1]. Part of this maintenance is
>
> By the way, this isn't true nowadays: Git does not use `git gc --auto`
> anymore, but instead `git maintenance run --auto`. So we really should
> be linking to "linkgit:git-maintenance[1]".
>
> This tool _by default_ executes git-gc(1). But it can be configured to
> use alternative strategies, and when using scalar(1) we actually use a
> different strategy.

For the curious, this happened around a95ce124 (maintenance: replace
run_auto_gc(), 2020-09-17).

> Not quite true. Pseudo refs are outside the hierarchy and are in fact
> treated differently. But root refs are treated the same as any other
> reference.
>
>     References are stored in a hierarchy. While most references are
>     stored in the "refs/" hierarchy, some references with special
>     meaning like for example "HEAD" are stored directly in the root of
>     the hierarchy.
>
> I don't really think we should get into root refs vs pseudo refs here,
> so maybe this is sufficient?

I do not think "root ref" (or pseudo for that matter) is a concept
that has no use in this context.  If this is really about data
model, where you find refs (or what the "pathname looking" thing
exactly look like that names your refs) should be immaterial.  It
does help to know that HEAD is just a ref.  It also would help to
know there are symbolic refs that point at other refs, which is much
more relevant to the data model.

Thanks.