Re: [PATCH 10/10] reftable: make reftable_record a tagged union
- From
Han-Wen Nienhuys <hanwen@google.com>
- Date
- Dec 8, 2021, 17:51 UTC
- Message-ID
- <CAFQ2z_OMK=w8j9a3BzQJxGQdc0RXY-zUoaBC08C-mjWiD+Vp1g@mail.gmail.com>
- In-Reply-To
- <xmqqv8zz2ge1.fsf@gitster.g>
On Wed, Dec 8, 2021 at 5:47 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> Perhaps reftable_record_for() can be implemented without changing > the shape of the underlying reftable_record structure in an earlier > step, then all the users of reftable_record instances can be > migrated to call it, and then finally the shape of the structure and > the implementation of reftable_record_for() can be updated?
We are going from
reftable_ref_record ref = { 0 };
reftable_record rec = { 0 };
record_from_ref_record(&rec, &ref);to
reftable_record rec = { .type = BLOCK_TYPE_REF };which is why this change is so nice. reftable_record_for() is used in just a few places, so it wouldn't make the change much smaller.
-- 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