git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 02/13] oidset2: create oidset subclass with object length and pathname

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Sep 27, 2017, 14:47 UTC
Message-ID
<5f028dc4-ce57-d628-19a3-006df7aa5bea@jeffhostetler.com>
In-Reply-To
<20170926152022.67d3d6bcc93d862aa1066207@google.com>
On 9/26/2017 6:20 PM, Jonathan Tan wrote:
Show 15 quoted lines
> On Fri, 22 Sep 2017 20:26:21 +0000
> Jeff Hostetler <git@jeffhostetler.com> wrote:
> 
>> 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).

I'll take a look at that. I'm not exactly happy with my oidset2, but it works and it minimized touching other things. But yes, it may clear up a few things.

Show 12 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?

Yeah, I struggled with that one. Git currently treats file size as a 32-bit unsigned value throughout the code. I assume eventually there will be a round of changes to support 64-bit values, so this anticipates that.

I could change it to be an unknown flag, rather assuming -1, but in an earlier draft I was printing -1 in the rev-list output. I can change this.

WRT a separate structure, the SET I create will contain entries for items where we may or may not know the size and that depends on the context. When building a list of already-missing blobs (with the --filter-print-missing) we never know the size. But when building a list of to-be-omitted blobs (from the current set of filter options), we may or may not know. I'm not sure we need 2 _entry definitions right now.

Previous: Jonathan TanNext: Jeff Hostetler
Message 6 of 16 in “RFC object filtering for parital clone”
  1. 00/13 RFC object filtering for parital cloneJeff Hostetler, Sep 22, 2017
  2. 01/13 dir: refactor add_excludes()Jeff Hostetler, Sep 22, 2017
  3. 02/13 oidset2: create oidset subclass with object length and pathnameJeff Hostetler, Sep 22, 2017
  4. Brandon WilliamsSep 22, 2017
  5. Jonathan TanSep 26, 2017
  6. Jeff HostetlerSep 27, 2017
  7. 03/13 list-objects: filter objects in traverse_commit_listJeff Hostetler, Sep 22, 2017
  8. Jonathan TanSep 26, 2017
  9. Jeff HostetlerSep 27, 2017
  10. Jonathan TanSep 27, 2017
  11. Jeff HostetlerSep 27, 2017
  12. Jonathan TanSep 27, 2017
  13. 04/13 list-objects-filter-all: add filter to omit all blobsJeff Hostetler, Sep 22, 2017
  14. Jonathan TanSep 23, 2017
  15. Jeff HostetlerSep 26, 2017
  16. Jeff HostetlerSep 26, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.