Re: [PATCH v10 03/12] create .git/refs in files-backend.c
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 30, 2020, 21:49 UTC
- Message-ID
- <xmqq368kr6ec.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200430212410.GF77802@google.com>
Emily Shaffer <emilyshaffer@google.com> writes:
Show 8 quoted lines
>> - safe_create_dir(git_path("refs"), 1);
>> - adjust_shared_perm(git_path("refs"));
>
> Is the reftable completely replacing the refs/ dir? Or is the idea that
> the refs/ dir is only used by the files backend? The commit message
> makes it sound like it's an additional format to support, so I'm a
> little confused. Why does the other currently-existing backend not need
> the refs/ dir at this stage?Other current backend being the files-backend, which creates it below, isn't this a no-op at this stage?
What's more interesting is what would happen when a repo is initialized with the reftable backend as its sole backend.
Even then, the repository discovery code of existing versions of Git needs to see a directory with a ".git" subdirectory, in the latter of which there must be HEAD and objects and refs subdirectories, so we'd need to create refs/ directory even if reftable does not use it.
This step, from that point of view, may not be necessary. But as long as we make sure any repository creates refs/ and objects/ directories, regardless of the ref backend, we'd be OK.