git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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
Next: Patrick Steinhardt
Message 1 of 7 in “packfile: some lifecycle improvements”
  1. 0/6 packfile: some lifecycle improvementsPatrick Steinhardt, Nov 20, 2026
  2. 1/6 builtin/fast-import: stop reporting packfile statisticsPatrick Steinhardt, Nov 20, 2026
  3. 2/6 packfile: rename lifecycle functionsPatrick Steinhardt, Nov 20, 2026
  4. 3/6 packfile: inline `open_packed_git_1()`Patrick Steinhardt, Nov 20, 2026
  5. 4/6 packfile: introduce function to free a packfilePatrick Steinhardt, Nov 20, 2026
  6. 5/6 packfile: maintain process-wide limits globallyPatrick Steinhardt, Nov 20, 2026
  7. 6/6 packfile: skip closing packs marked as do-not-closePatrick Steinhardt, Nov 20, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.