From: Junio C Hamano Date: Sun, 15 Mar 2015 02:32:29 GMT Subject: Re: [PATCH v2 01/10] Define a structure for object IDs. Message-ID: In-Reply-To: Duy Nguyen writes: > Notice that the first time pack->obj[] is filled using > lookup_object(). So yes, the hash table has all the pointers that > pack->obj[] has. Are we talking about the same thing? By "the hash table", I mean **obj_hash that is a hashtable that uses form of identifier as the key. So "the hash table has all the pointers" sounds like all the objects you instantiate from a v4 packfile needs their object name known in the form anyway when it gets instantiated (or more importantly, when you realize there is another copy of it already in the **obj_hash hashtable, you may have to free or refrain from creating it in the first place). As long as we use **obj_hash hashtable as "all the objects this process cares about in the world" and "struct object_id.hash" as the key into it, I do not think representation belongs to that layer. I do think representation has its use as a short-cut mechanism to reach an indirectly referenced object directly without instantiating intermediate objects when dealing with an extended SHA-1 expression (cf. "v1.0^0:t" example in a few messages upthread). I just think it does not belong to "struct object_id" that are used to refer to in-core objects.