Re: [PATCH 02/13] oidset2: create oidset subclass with object length and pathname
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Sep 26, 2017, 22:20 UTC
- Message-ID
- <20170926152022.67d3d6bcc93d862aa1066207@google.com>
- In-Reply-To
- <20170922202632.53714-3-git@jeffhostetler.com>
On Fri, 22 Sep 2017 20:26:21 +0000 Jeff Hostetler <git@jeffhostetler.com> wrote:
Show 9 quoted lines
> From: Jeff Hostetler <jeffhost@microsoft.com> > > Create subclass of oidset where each entry has a > field to store the length of the object's content > and an optional pathname. > > This will be used in a future commit to build a > manifest of omitted objects in a partial/narrow > clone/fetch.
As Brandon mentioned, I think "oidmap" should be the new data structure of choice (with "oidset" modified to use it).
Show 8 quoted lines
> +struct oidset2_entry {
> + struct hashmap_entry hash;
> + struct object_id oid;
> +
> + enum object_type type;
> + int64_t object_length; /* This is SIGNED. Use -1 when unknown. */
> + char *pathname;
> +};object_length is defined to be "unsigned long" in Git code, I think. When is object_length not known, and in those cases, would it be better to use a separate data structure to store what we need?