Re: [PATCH] refs: introduce API function to write invalid null ref
From: Han-Wen Nienhuys <hidden>
Date: 2021-02-22 18:39:54
On Mon, Feb 22, 2021 at 1:41 AM Stefan Beller [off-list ref] wrote:
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 <redacted> --- 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