packfiles: track pack lists via the packfile store
Hi,
while the recently-introduced packfile store tracks the head of the pack
lists, the actual lists themselves are still stored in a globally linked
list via the struct packed_git::next
pointer. This makes it quite hard
to split up that list into per-object-source lists, as the assumption is
embedded in many places that one packfile will identify all the others.
This patch series thus moves the ownership of the lists into the packfile store. This prepares us for a subsequent change where we can push the packfile store one level down, from the object database into the object source.
Note: I'd like to have some extra careful eyes on the last patch. This patch merges the two packfile lists we currently have (MRU and mtime-sorted). This patch is not needed to achieve my goal in this series, but there was some discussion around whether we really need both lists. I don't think we do, and in fact I think it causes confusion which of these one should really use.
The default is to use the mtime-sorted list, which I think is the wrong choice in many cases, but that is only by gut feeling. So I'm dropping that list in favor of the MRU list, but there is one gotcha here: when iterating through packfiles and then reading their respective objects, we end up in an infinite loop because we end up moving the respective packfile to the front of the list again. I'm fixing that with a new field that skips the MRU update, but I'm not quite sure wheter I think that this is too fragile or not.
The series is built on top of 60f3f52f (The sixteenth batch,
2025-10-08) with ps/remove-packfile-store-get-packs at b009b552
(packfile: rename packfile_store_get_all_packs()
, 2025-10-09) merged
into it.
Thanks!
Patrick
--- b4-submit-tracking ---
This section is used internally by b4 prep for tracking purposes.
{ "series": { "revision": 1, "change-id": "20251010-pks-packfiles-store-drop-list-64ea0a4c9a3b", "prefixes": [] } }