Re: [PATCH 4/4] get_oid(): when an object was not found, try harder
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 14, 2019, 03:49 UTC
- Message-ID
- <xmqq8sxiaze2.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190314022245.GA1414@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
>> 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 ;-).
Show 9 quoted lines
>> 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.