Re: [PATCH] Make object contents optionally available
- From
Junio C Hamano <junkio@cox.net>
- Date
- May 17, 2005, 19:32 UTC
- Message-ID
- <7vbr79fy22.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.21.0505171325150.30848-100000@iabervon.org>
>>>>> "DB" == Daniel Barkalow <barkalow@iabervon.org> writes:
DB> It wouldn't make any types special; the caller can just control each type DB> individually, so that code that only cares about commits could get commits DB> unpacked, but not get trees unpacked even if it has them parsed.
That is exactly the behaviour I am questioning about. You are giving the caller the ability to discriminate objects based on their _type_ (which is fine and better than not having that control at all). Why can't the caller discriminate objects based on their, say, size for example [*1*]? That's what I meant to say by "types are special" but I phrased it so badly. And the callback would solve that naturally. Or you can additionally give the callback the result of the parse_xxx(), which would be even more useful. The callback can then throw commit raw-data away based on the date, for example.
[Footnote]
*1* So this hypothethical program uses fast cached raw data for small things but is willing to pay penalty for big things if it later finds those big things turn out to be needed.