[PATCH 0/6] packfile: some lifecycle improvements
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Nov 20, 2026, 12:02 UTC
- Message-ID
- <20261120-pks-packfile-global-statistics-v1-0-19beb83b145f@pks.im>
Hi,
this small patch series polishes our lifecycle handling of packfiles a bit. The original motivation of this patch series is really only the last patch, which fixes how we handle process-wide limitations. But I took the chance to also polish this subsystem a bit, as a lot of its parts feel rather dated nowadays.
There's a minor semantic merge conflict with "seen" that can be sovled like this:
diff --git a/odb/source-packed.c b/odb/source-packed.c index 77f8227ae52..e24f6cc7ef9 100644 --- a/odb/source-packed.c +++ b/odb/source-packed.c @@ -898,7 +898,7 @@ static int odb_source_packed_map_oid(struct odb_source *source, &hash_algos[src->algo] : repo->hash_algo; - if (open_pack_index(p) || !p->num_objects) + if (packfile_open_index(p) || !p->num_objects) continue; /* Only v3 indices store object IDs in both algorithms. */ if (p->index_version < 3) Thanks! Patrick --- Patrick Steinhardt (6): builtin/fast-import: stop reporting packfile statistics packfile: rename lifecycle functions packfile: inline `open_packed_git_1()` packfile: introduce function to free a packfile packfile: maintain process-wide limits globally packfile: skip closing packs marked as do-not-close Documentation/git-fast-import.adoc | 5 +- builtin/count-objects.c | 2 +- builtin/fast-import.c | 8 +- builtin/index-pack.c | 16 +-- builtin/pack-objects.c | 2 +- builtin/pack-redundant.c | 2 +- commit-graph.c | 12 +- connected.c | 10 +- http-push.c | 2 +- http-walker.c | 8 +- http.c | 4 +- midx-write.c | 23 ++-- midx.c | 6 +- odb/source-packed.c | 14 +-- pack-check.c | 2 +- pack-mtimes.c | 2 +- pack-revindex.c | 4 +- packfile.c | 233 ++++++++++++++++++------------------- packfile.h | 30 ++--- repack-geometry.c | 2 +- repack-midx.c | 2 +- t/helper/test-bitmap.c | 2 +- 22 files changed, 182 insertions(+), 209 deletions(-) --- base-commit: f7de81456940dd6f3274e461149bba12965de609 change-id: 20261120-pks-packfile-global-statistics-92a9be97a11f