Re: [PATCH 1/7] setup: extract function to create the refdb
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Dec 11, 2023, 15:50 UTC
- Message-ID
- <CAOLa=ZRTQ3X7+PnNHaAeM5vKh=x3Vq9C_H1emUNzJB6PUBBwEA@mail.gmail.com>
- In-Reply-To
- <ZXFy0_T1AZLh058g@tanuki>
Patrick Steinhardt <ps@pks.im> writes:
Show 26 quoted lines
> On Wed, Dec 06, 2023 at 10:10:37PM +0100, Karthik Nayak wrote: >> On Wed, Dec 6, 2023 at 1:40 PM Patrick Steinhardt <ps@pks.im> wrote: >> > + /* >> > + * We need to create a "refs" dir in any case so that older >> > + * versions of git can tell that this is a repository. >> > + */ >> >> How does this work though, even if an earlier version of git can tell >> that this is a repository, it still won't be able to read the reftable >> backend. In that sense, what do we achieve here? > > This is a good question, and there is related ongoing discussion about > this topic in the thread starting at [1]. There are a few benefits to > letting clients discover such repos even if they don't understand the > new reference backend format: > > - They know to stop walking up the parent-directory chain. Otherwise a > client might end up detecting a Git repository in the parent dir. > > - The user gets a proper error message why the repository cannot be > accessed. Instead of failing to detect the repository altogether we > instead say that we don't understand the "extensions.refFormat" > extension. > > Maybe there are other cases I can't think of right now. > [1]: <ZWcOvjGPVS_CMUAk@tanuki>
Thank Patrick, this does indeed make a lot of sense now. +1 that this would be super useful as a comment here.