Re: What's cooking in git.git (Jan 2024, #01; Tue, 2)
- From
Jeff King <peff@peff.net>
- Date
- Jan 5, 2024, 08:59 UTC
- Message-ID
- <20240105085928.GA3078702@coredump.intra.peff.net>
- In-Reply-To
- <xmqq8r56bcew.fsf@gitster.g>
On Wed, Jan 03, 2024 at 08:37:59AM -0800, Junio C Hamano wrote:
Show 12 quoted lines
> This is totally unrelated tangent, but the way "show-index" gets > invoked in the above loop makes readers wonder how the caller found > out which $idx file to read. > > Of course, the above loop sits downstream of a pipe > > find .git/objects/pack -type f -name \*.idx > > which means that any user of "git show-index" must be intimately > familiar with how the object database is structured. I wonder if we > want an extra layer of abstraction, similar to how the reference > database can have different backend implementation.
I assume you mean a test helper by "extra layer of abstraction".
That could make sense, though I think this is just the tip of the iceberg. There are a bazillion tests that muck with .git/objects/ directly (especially ones finding and munging loose objects). So it wouldn't do much good until we know what cases the abstract code would have to handle. And I don't think we have any concrete alternative yet to the current object-dir layout.
So I think we should just punt on it for now. Adding one case here is not making a hypothetical abstraction layer significantly harder to add later.
-Peff