Re: [RFC PATCH 1/5] ref-filter: add objectsize:disk option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 21, 2018, 00:27 UTC
- Message-ID
- <xmqqa7m39swq.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CAL21BmmK_ZS=wuGXRLj=s0=dqMvUWFiLLBZWx5ymnFjyasX=sA@mail.gmail.com>
Оля Тележная <olyatelezhnaya@gmail.com> writes:
Show 10 quoted lines
>> I am OK if we avoid PRIdMAX and use PRIuMAX instead with a cast to >> the corresponding size in this codepath, as long as we properly >> handle negative oi.disk_size field, which may be telling some >> "unusual" condition to us. > > Maybe we want to change the type (from off_t to unsigned) directly in > struct object_info? That will help us not to make additional > checkings. Or, at least, I suggest to add check to > oid_object_info_extended() so that this function will give a guarantee > that the size is non-negative.
I am fine with the approach. The potential gain of allowing oi.disk_size is it would allow the code to say "I'll give these pieces of info about the object, but the on-disk size is unknown" without failing the whole object_info_extended() request. And I personally do not think such an ability is not all that important or useful.