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

[PATCH v2 00/12] odb: make optimizations pluggable

From
Patrick Steinhardt <ps@pks.im>
Date
Jul 13, 2026, 05:52 UTC
Message-ID
<20260713-b4-pks-odb-optimize-v2-0-9c2c3ee94b38@pks.im>
In-Reply-To
<20260707-b4-pks-odb-optimize-v1-0-aae607667be4@pks.im>
Hi,

this patch series converts object housekeeping to become pluggable. There isn't really anything else to say about this.

The series is built on top of f85a7e6620 (Start Git 2.56 cycle, 2026-07-06).

Changes in v2:
  - Make tests in t7900 a bit more robust by not checking for exact
    commands, but instead by checking for executed tasks.
  - Link to v1: https://patch.msgid.link/20260707-b4-pks-odb-optimize-v1-0-aae607667be4@pks.im
Thanks!
Patrick
---
Patrick Steinhardt (12):
      t7900: simplify how we check for maintenance tasks
      odb: run "pre-auto-gc" hook for all maintenance tasks
      builtin/gc: move worktree and rerere tasks before object optimizations
      builtin/gc: extract object database optimizations into separate function
      builtin/gc: make repack arguments self-contained
      builtin/gc: inline config values specific to the "files" backend
      builtin/gc: introduce object database optimization options
      builtin/gc: move geometric repacking into `odb_optimize()`
      builtin/gc: introduce `odb_optimize_required()`
      builtin/gc: refactor ODB optimizations to operate on "files" source
      builtin/gc: fix signedness issues in ODB-related functionality
      odb: make optimizations pluggable
 builtin/gc.c           | 534 ++++++++-----------------------------------------
 odb.c                  |  12 ++
 odb.h                  |  45 +++++
 odb/source-files.c     | 470 +++++++++++++++++++++++++++++++++++++++++++
 odb/source-files.h     |  15 ++
 odb/source.h           |  36 ++++
 t/t7900-maintenance.sh | 338 +++++++++++++++++++++----------
 7 files changed, 894 insertions(+), 556 deletions(-)
Range-diff versus v1:
 -:  ---------- >  1:  b05988c150 t7900: simplify how we check for maintenance tasks
 1:  df9ed71c10 !  2:  734d3c6d17 odb: run "pre-auto-gc" hook for all maintenance tasks
    @@ t/t7900-maintenance.sh: test_expect_success 'geometric repacking honors configur
     +			git maintenance run --auto 2>/dev/null &&
     +
     +		# The successful hook does not inhibit any of the tasks...
    -+		test_subcommand git reflog expire --all <trace2.txt &&
    -+		test_subcommand_flex git repack <trace2.txt &&
    -+		test_subcommand git rerere gc <trace2.txt &&
    ++		test_maintenance_tasks trace2.txt <<-\EOF &&
    ++		reflog-expire foreground
    ++		geometric-repack
    ++		rerere-gc
    ++		EOF
     +		# ... but it must only have been executed a single time.
     +		test_line_count = 1 hook.log
     +	)
    @@ t/t7900-maintenance.sh: test_expect_success 'geometric repacking honors configur
     +		# is expected to be the only child process being spawned, and
     +		# it must only run a single time.
     +		test_grep "child_start.*pre-auto-gc" trace2.txt &&
    -+		test_subcommand_flex ! git trace2 &&
    ++		test_maintenance_tasks trace2.txt <<-\EOF &&
    ++		EOF
     +		test_line_count = 1 hook.log
     +	)
     +'
    @@ t/t7900-maintenance.sh: test_expect_success 'geometric repacking honors configur
     +		# is expected to be the only child process being spawned, and
     +		# it must only run a single time.
     +		test_grep "child_start.*pre-auto-gc" trace2.txt &&
    ++		test_maintenance_tasks trace2.txt <<-\EOF &&
    ++		EOF
     +		test_subcommand_flex ! git trace2 &&
     +		test_line_count = 1 hook.log
     +	)
 2:  ba358cede1 =  3:  a61f01a1c1 builtin/gc: move worktree and rerere tasks before object optimizations
 3:  ffbaf71f46 =  4:  3d6ea9927b builtin/gc: extract object database optimizations into separate function
 4:  7b568dcd0c =  5:  de2c2c084d builtin/gc: make repack arguments self-contained
 5:  e18465b4b2 =  6:  0b4f6a553d builtin/gc: inline config values specific to the "files" backend
 6:  4ee5a61e44 =  7:  e231c437ba builtin/gc: introduce object database optimization options
 7:  2b428d4516 !  8:  b015c35c8a builtin/gc: move geometric repacking into `odb_optimize()`
    @@ t/t7900-maintenance.sh: test_expect_success 'geometric repacking honors configur
      	)
      '
      
    -@@ t/t7900-maintenance.sh: test_expect_success 'maintenance.strategy is respected' '
    - 		test_strategy geometric <<-\EOF &&
    - 		git pack-refs --all --prune
    - 		git reflog expire --all
    --		git repack -d -l --geometric=2 --quiet --write-midx
    -+		git repack -d -l -q --geometric=2 --write-midx
    - 		git commit-graph write --split --reachable --no-progress
    - 		git worktree prune --expire 3.months.ago
    - 		git rerere gc
    -@@ t/t7900-maintenance.sh: test_expect_success 'maintenance.strategy is respected' '
    - 		test_strategy geometric --schedule=weekly <<-\EOF
    - 		git pack-refs --all --prune
    - 		git reflog expire --all
    --		git repack -d -l --geometric=2 --quiet --write-midx
    -+		git repack -d -l -q --geometric=2 --write-midx
    - 		git commit-graph write --split --reachable --no-progress
    - 		git worktree prune --expire 3.months.ago
    - 		git rerere gc
 8:  79c3d77210 =  9:  426a06b349 builtin/gc: introduce `odb_optimize_required()`
 9:  15f65ab0bf = 10:  cfb6014c30 builtin/gc: refactor ODB optimizations to operate on "files" source
10:  9035d7d679 = 11:  a478e0e0b3 builtin/gc: fix signedness issues in ODB-related functionality
11:  8fa84c3aa0 = 12:  5383b9027c odb: make optimizations pluggable

--- base-commit: f85a7e662054a7b0d9070e432508831afa214b47 change-id: 20260612-b4-pks-odb-optimize-3426c57e5c30

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 17 of 33 in “odb: make optimizations pluggable”
  1. 00/11 odb: make optimizations pluggablePatrick Steinhardt, Jul 7, 2026
  2. 01/11 odb: run "pre-auto-gc" hook for all maintenance tasksPatrick Steinhardt, Jul 7, 2026
  3. Junio C HamanoJul 7, 2026
  4. Patrick SteinhardtJul 8, 2026
  5. 02/11 builtin/gc: move worktree and rerere tasks before object optimizationsPatrick Steinhardt, Jul 7, 2026
  6. Junio C HamanoJul 7, 2026
  7. 03/11 builtin/gc: extract object database optimizations into separate functionPatrick Steinhardt, Jul 7, 2026
  8. Junio C HamanoJul 7, 2026
  9. 04/11 builtin/gc: make repack arguments self-containedPatrick Steinhardt, Jul 7, 2026
  10. 05/11 builtin/gc: inline config values specific to the "files" backendPatrick Steinhardt, Jul 7, 2026
  11. 06/11 builtin/gc: introduce object database optimization optionsPatrick Steinhardt, Jul 7, 2026
  12. 07/11 builtin/gc: move geometric repacking into `odb_optimize()`Patrick Steinhardt, Jul 7, 2026
  13. 08/11 builtin/gc: introduce `odb_optimize_required()`Patrick Steinhardt, Jul 7, 2026
  14. 09/11 builtin/gc: refactor ODB optimizations to operate on "files" sourcePatrick Steinhardt, Jul 7, 2026
  15. 10/11 builtin/gc: fix signedness issues in ODB-related functionalityPatrick Steinhardt, Jul 7, 2026
  16. 11/11 odb: make optimizations pluggablePatrick Steinhardt, Jul 7, 2026
  17. 00/12 odb: make optimizations pluggablePatrick Steinhardt, Jul 13, 2026
  18. 01/12 t7900: simplify how we check for maintenance tasksPatrick Steinhardt, Jul 13, 2026
  19. 02/12 odb: run "pre-auto-gc" hook for all maintenance tasksPatrick Steinhardt, Jul 13, 2026
  20. 03/12 builtin/gc: move worktree and rerere tasks before object optimizationsPatrick Steinhardt, Jul 13, 2026
  21. 04/12 builtin/gc: extract object database optimizations into separate functionPatrick Steinhardt, Jul 13, 2026
  22. 05/12 builtin/gc: make repack arguments self-containedPatrick Steinhardt, Jul 13, 2026
  23. 06/12 builtin/gc: inline config values specific to the "files" backendPatrick Steinhardt, Jul 13, 2026
  24. 07/12 builtin/gc: introduce object database optimization optionsPatrick Steinhardt, Jul 13, 2026
  25. 08/12 builtin/gc: move geometric repacking into `odb_optimize()`Patrick Steinhardt, Jul 13, 2026
  26. 09/12 builtin/gc: introduce `odb_optimize_required()`Patrick Steinhardt, Jul 13, 2026
  27. 10/12 builtin/gc: refactor ODB optimizations to operate on "files" sourcePatrick Steinhardt, Jul 13, 2026
  28. 11/12 builtin/gc: fix signedness issues in ODB-related functionalityPatrick Steinhardt, Jul 13, 2026
  29. Junio C HamanoJul 13, 2026
  30. Patrick SteinhardtJul 22, 2026
  31. Junio C HamanoJul 26, 2026
  32. 12/12 odb: make optimizations pluggablePatrick Steinhardt, Jul 13, 2026
  33. Junio C HamanoJul 13, 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.