Re: [PATCH] refs: introduce API function to write invalid null ref
- From
Han-Wen Nienhuys <hanwen@google.com>
- Date
- Feb 22, 2021, 18:38 UTC
- Message-ID
- <CAFQ2z_Ob1Ego0vZgW1g3h34LF9H5ZggrLJY4FQHPGaCwVPq8pQ@mail.gmail.com>
- In-Reply-To
- <20210222004112.99268-1-stefanbeller@gmail.com>
On Mon, Feb 22, 2021 at 1:41 AM Stefan Beller <stefanbeller@gmail.com> wrote:
Show 18 quoted lines
> > Different ref backends will have different ways to write out the invalid 00..00 > ref when starting a new worktree. Encapsulate this into a function and expose > the function in the refs API. > > Signed-off-by: Stefan Beller <stefanbeller@gmail.com> > --- > > Hi Han-Wen, > > it's been a while since I looked at git source code, but today is the day! > I was actually looking how the refs table work progresses and this patch > caught my attention. I think the changes in builtin/worktree.c (that > if/else depending on the actual refs backend used) > demonstrate that the refs API layer is leaking implementation details. > > What do you think about rolling this patch first, and then implementing > the following part inside the reftable as a function?
The "invalid HEAD" hack is there to avoid confusing historical git implementations. It's not a part of the "modern" refs API layer, so I think we shouldn't add it as a method on the ref backend API.
-- Han-Wen Nienhuys - Google Munich I work 80%. Don't expect answers from me on Fridays. -- Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Paul Manicle, Halimah DeLaine Prado