Web lists-archives.com

Re: [PATCH 4/4] get_oid(): when an object was not found, try harder




Jeff King <peff@xxxxxxxx> writes:

>>  1. is reprepare_packed_git() a bit too heavy-weight, if the only
>>     thing we are addressing is the loose-object cache going stale?
>
> It's not the only thing we are addressing. :)
>
> Try this:

Yes, I knew about repacking.  I was alluding to the overly heavy
reference to loose-object-cache in the log message ;-).

>>  2. is there a way to cleanly avoid the three-line duplicate?
>
> Yeah, as you noted, I think the boilerplate is worse than the
> duplication. The most readable alternative to me is a separate function,
> like:
> ...
> But what I find particularly ugly is not just that it's more lines, but
> that the assumptions and outputs of do_get_short_oid() aren't
> particularly clear.

Yeah, exactly.