Re: [PATCH 2/2] pack-objects: rename the field "type" to "real_type"
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jul 8, 2015, 13:57 UTC
- Message-ID
- <CACsJy8B0OCu3-TKVztj+wCmtqXdeh6iNK5ir4Xi2BXWW14wdOQ@mail.gmail.com>
- In-Reply-To
- <20150708134713.GA5136@peff.net>
On Wed, Jul 8, 2015 at 8:47 PM, Jeff King <peff@peff.net> wrote:
Show 9 quoted lines
> On Wed, Jul 08, 2015 at 06:56:31PM +0700, Nguyễn Thái Ngọc Duy wrote: > >> This is to avoid the too generic name "type" and harmonize with the >> naming in index-pack. There's a subtle difference though: real_type in >> index-pack is what the upper level see, no delta types (after delta >> resolution). But real_type in pack-objects is the type to be written in >> the pack, delta types are fine (it's actually markers for reused deltas) > > Hrm, now I'm confused about whether this change is a good idea.
Oh good :) I found it not-so-good too after seeing the check "if (real_type == OBJ_REF...)"
Show 6 quoted lines
> The definition of in_pack_type says: > >> enum object_type in_pack_type; /* could be delta */ > > so now I am confused about what exactly "type" (and now "real_type") > means.
I think we just overload "type" with "this delta is detected reusable already" in write_object(). It only means 'real type in the output pack' for canonical types. For generated deltas, we already know if it's ref-delta or ofs-delta, we don't rely on real_type
-- Duy