Re: [RFC PATCH v2 4/4] sha1_file: support promised object hook
- From
Ben Peart <peartben@gmail.com>
- Date
- Jul 21, 2017, 16:27 UTC
- Message-ID
- <a3d1d0b9-5d28-e643-4964-6d087b7b0ec2@gmail.com>
- In-Reply-To
- <20170720141804.22cdd2bf@twelve2.svl.corp.google.com>
On 7/20/2017 5:18 PM, Jonathan Tan wrote:
Show 24 quoted lines
> On Thu, 20 Jul 2017 16:58:16 -0400
> Ben Peart <peartben@gmail.com> wrote:
>
>>>> This is meant as a temporary measure to ensure that all Git commands
>>>> work in such a situation. Future patches will update some commands to
>>>> either tolerate promised objects (without invoking the hook) or be more
>>>> efficient in invoking the promised objects hook.
>>
>> I agree that making git more tolerant of promised objects if possible
>> and precomputing a list of promised objects required to complete a
>> particular command and downloading them with a single request are good
>> optimizations to add over time.
>
> That's good to know!
>
>> has_sha1_file also takes a hash "whether local or in an alternate object
>> database, and whether packed or loose" but never calls
>> sha1_object_info_extended. As a result, we had to add support in
>> check_and_freshen to download missing objects to get proper behavior in
>> all cases. I don't think this will work correctly without it.
>
> Thanks for the attention to detail. Is this before or after commit
> e83e71c ("sha1_file: refactor has_sha1_file_with_flags", 2017-06-26)?
> Sorry, my bad. I missed the comment in the cover letter that said this needed to be applied on top of your other patch series.