Re: [PATCH 10/13] rev-list: add list-objects filtering support
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);
>> }