Re: [PATCH 11/16] packfile: always add packfiles to MRU when adding a pack
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Aug 20, 2025, 13:35 UTC
- Message-ID
- <CAOLa=ZTv-=it8WSDx2SwdC99mzUF=0q9NJvp6yWwHzCThaL0Ag@mail.gmail.com>
- In-Reply-To
- <20250819-b4-pks-packfiles-store-v1-11-1660842e125a@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 9 quoted lines
> When adding a packfile to it store we add it both to the list and map of > packfiles, but we don't append it to the most-recently-used list of > packs. We do know to add the packfile to the MRU list as soon as we > access any of its objects, but in between we're being inconistent. It > doesn't help that there are some subsystems that _do_ add the packfile > to the MRU after having added it, which only adds to the confusion. > > Refactor the code so that we unconditionally add packfiles to the MRU > when adding them to a packfile store.
This makes sense.
It would be really nice if the internals of packfile_store is private, that way users wouldn't know/care about the mru in the first place. Till this patch, we seem to be moving in that direction as more things move into `packfile_store` we can slowly abstract it behind a strong set of APIs and internals can be kept private.
[snip]