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

Re: [PATCH 10/13] rev-list: add list-objects filtering support

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Oct 25, 2017, 19:37 UTC
Message-ID
<4afe76f0-a243-126b-b3e0-d2d08640e73d@jeffhostetler.com>
In-Reply-To
<CAGf8dgK3pW8T4Tst6LZuJxLZTDjk7Ak5iwK0WYBSLrWR1S8YBg@mail.gmail.com>
On 10/25/2017 12:41 AM, Jonathan Tan wrote:
Show 31 quoted lines
> On Tue, Oct 24, 2017 at 11:53 AM, Jeff Hostetler <git@jeffhostetler.com> wrote:
>>   static void finish_object(struct object *obj, const char *name, void *cb_data)
>>   {
>>          struct rev_list_info *info = cb_data;
>> -       if (obj->type == OBJ_BLOB && !has_object_file(&obj->oid))
>> +       if (obj->type == OBJ_BLOB && !has_object_file(&obj->oid)) {
>> +               if (arg_print_missing) {
>> +                       list_objects_filter_map_insert(
>> +                               &missing_objects, &obj->oid, name, obj->type);
>> +                       return;
>> +               }
>> +
>> +               /*
>> +                * Relax consistency checks when we expect missing
>> +                * objects because of partial-clone or a previous
>> +                * partial-fetch.
>> +                *
>> +                * Note that this is independent of any filtering that
>> +                * we are doing in this run.
>> +                */
>> +               if (is_partial_clone_registered())
>> +                       return;
>> +
>>                  die("missing blob object '%s'", oid_to_hex(&obj->oid));
> 
> I'm fine with arg_print_missing suppressing lazy fetching (when I
> rebase my patches on this, I'll have to ensure that fetch_if_missing
> is set to 0 if arg_print_missing is true), but I think that the
> behavior when arg_print_missing is false should be the opposite - we
> should let has_object_file() perform the lazy fetching, and die if it
> returns false (that is, if the fetching failed).
Right. This is a point where our different approaches need
to come together.  My "is_partial_clone_registered" is essentially
a placeholder for your lazy fetching.  so we can delete this call
when your changes are in.  Basically, you set:
	fetch_if_missing = !arg_print_missing
at the top.
Show 5 quoted lines
> 
>> +       }
>>          if (info->revs->verify_objects && !obj->parsed && obj->type != OBJ_COMMIT)
>>                  parse_object(&obj->oid);
>>   }
Previous: Jonathan TanNext: Jeff Hostetler
Message 16 of 37 in “WIP Partial clone part 1: object filtering”
  1. 00/13 WIP Partial clone part 1: object filteringJeff Hostetler, Oct 24, 2017
  2. 02/13 list-objects-filter-map: extend oidmap to collect omitted objectsJeff Hostetler, Oct 24, 2017
  3. Junio C HamanoOct 25, 2017
  4. Jeff HostetlerOct 25, 2017
  5. Junio C HamanoOct 26, 2017
  6. 06/13 list-objects-filter-sparse: add sparse filterJeff Hostetler, Oct 24, 2017
  7. 08/13 list-objects: add traverse_commit_list_filtered methodJeff Hostetler, Oct 24, 2017
  8. Jonathan TanOct 25, 2017
  9. Jeff HostetlerOct 25, 2017
  10. 11/13 t6112: rev-list object filtering testJeff Hostetler, Oct 24, 2017
  11. 05/13 list-objects-filter-blobs-limit: add large blob filteringJeff Hostetler, Oct 24, 2017
  12. 13/13 t5317: pack-objects object filtering testJeff Hostetler, Oct 24, 2017
  13. 12/13 pack-objects: add list-objects filteringJeff Hostetler, Oct 24, 2017
  14. 10/13 rev-list: add list-objects filtering supportJeff Hostetler, Oct 24, 2017
  15. Jonathan TanOct 25, 2017
  16. Jeff HostetlerOct 25, 2017
  17. 04/13 list-objects-filter-blobs-none: add filter to omit all blobsJeff Hostetler, Oct 24, 2017
  18. 09/13 extension.partialclone: introduce partial clone extensionJeff Hostetler, Oct 24, 2017
  19. 01/13 dir: allow exclusions from blob in addition to fileJeff Hostetler, Oct 24, 2017
  20. Eric SunshineOct 25, 2017
  21. Junio C HamanoOct 25, 2017
  22. Jeff HostetlerOct 25, 2017
  23. Junio C HamanoOct 26, 2017
  24. Jeff HostetlerOct 26, 2017
  25. 07/13 list-objects-filter-options: common argument parsingJeff Hostetler, Oct 24, 2017
  26. Jonathan TanOct 25, 2017
  27. Jeff HostetlerOct 25, 2017
  28. 03/13 list-objects: filter objects in traverse_commit_listJeff Hostetler, Oct 24, 2017
  29. Jonathan TanOct 25, 2017
  30. Jeff HostetlerOct 25, 2017
  31. Jonathan TanOct 25, 2017
  32. Junio C HamanoOct 25, 2017
  33. Jonathan TanOct 25, 2017
  34. Jeff HostetlerOct 25, 2017
  35. Junio C HamanoOct 26, 2017
  36. Junio C HamanoOct 26, 2017
  37. Jonathan NiederOct 30, 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.