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

[PATCH v3 00/10] odb: make consistency checks pluggable

From
Patrick Steinhardt <ps@pks.im>
Date
Sep 11, 2026, 13:27 UTC
Message-ID
<20260911-pks-odb-source-fsck-v3-0-ef2fdc085e38@pks.im>
In-Reply-To
<20260825-pks-odb-source-fsck-v1-0-b756de0bf24f@pks.im>
Hi,
this patch series makes object database consistency checks pluggable.

This series is built on top of 2c3adbb2c4 (The 18th batch, 2026-08-24) with the following two dependencsie merged into it:

  - ps/odb-eagerly-load-alternates at 0076dc9f81 (odb: drop
    `alternates_db` field, 2026-08-17)
  - ps/odb-pluggable-pack-generation at 5176dd3d05 (bundle: generate
    packfiles via the object database, 2026-08-21)
Changes in v3:
  - Move check for `ODB_FSCK_FULL || local` into the "files" backend.
  - Ensure that repo settings are prepared.
  - Drop a mostly-useless `ret` variable.
  - Link to v2: https://patch.msgid.link/20260831-pks-odb-source-fsck-v2-0-f9b16ef4957b@pks.im
Changes in v2:
  - Some commit message improvements.
  - Link to v1: https://patch.msgid.link/20260825-pks-odb-source-fsck-v1-0-b756de0bf24f@pks.im
Thanks!
Patrick
---
Patrick Steinhardt (10):
      builtin/fsck: use `fsck_obj_buffer()` when checking loose objects
      builtin/fsck: merge `fsck_obj_buffer()` and `fsck_obj()`
      builtin/fsck: de-globalize option handling
      builtin/fsck: don't check alternates with "--no-full"
      odb: provide infrastructure for pluggable fsck checks
      builtin/fsck: move packfile verification into the packed source
      builtin/fsck: move reverse index verification into the packed source
      builtin/fsck: move bitmap verification into the packed source
      builtin/fsck: move multi-pack index verification into the packed source
      builtin/fsck: move loose object verification into the loose source
 builtin/fsck.c                | 296 ++++++++----------------------------------
 odb.c                         |   8 ++
 odb.h                         |  33 +++++
 odb/source-files.c            |  16 +++
 odb/source-inmemory.c         |   8 ++
 odb/source-loose.c            |  92 +++++++++++++
 odb/source-packed.c           | 117 +++++++++++++++++
 odb/source.h                  |  21 +++
 pack-bitmap.c                 |  26 ++--
 pack-bitmap.h                 |   2 +-
 t/t1450-fsck.sh               |   5 +
 t/t5319-multi-pack-index.sh   |  13 ++
 t/t5325-reverse-index.sh      |   8 ++
 t/t5326-multi-pack-bitmaps.sh |  10 +-
 14 files changed, 396 insertions(+), 259 deletions(-)
Range-diff versus v2:
 1:  099ad8ddcd =  1:  575a49f5a1 builtin/fsck: use `fsck_obj_buffer()` when checking loose objects
 2:  4e223cfab6 =  2:  71040c9b34 builtin/fsck: merge `fsck_obj_buffer()` and `fsck_obj()`
 3:  108b522c55 =  3:  adb2e035ee builtin/fsck: de-globalize option handling
 4:  c686809406 =  4:  68d143fc9f builtin/fsck: don't check alternates with "--no-full"
 5:  a82a1a8ed2 !  5:  bb785f4f00 odb: provide infrastructure for pluggable fsck checks
    @@ odb.c: void odb_reprepare(struct object_database *o)
     +{
     +	int ret = 0;
     +	for (struct odb_source *source = odb->sources; source; source = source->next)
    -+		if ((options->flags & ODB_FSCK_FULL) || source->local)
    -+			ret |= odb_source_fsck(source, options);
    ++		ret |= odb_source_fsck(source, options);
     +	return ret;
     +}
     
    @@ odb/source-files.c: static int odb_source_files_generate_pack(struct odb_source
     +	struct odb_source_files *files = odb_source_files_downcast(source);
     +	int ret = 0;
     +
    ++	if (!(opts->flags & ODB_FSCK_FULL) && !source->local)
    ++		return 0;
    ++
     +	ret |= odb_source_fsck(&files->loose->base, opts);
     +	ret |= odb_source_fsck(&files->packed->base, opts);
     +
 6:  166d9ad073 =  6:  9df4ebd53e builtin/fsck: move packfile verification into the packed source
 7:  83f1b18308 =  7:  b7b28d2ab4 builtin/fsck: move reverse index verification into the packed source
 8:  a760738e7a =  8:  e0efbab606 builtin/fsck: move bitmap verification into the packed source
 9:  f0acd3bdff !  9:  5bebd3fded builtin/fsck: move multi-pack index verification into the packed source
    @@ odb/source-packed.c: static int verify_reverse_indices(struct odb_source_packed
     +		       struct odb_fsck_options *opts)
     +{
     +	struct child_process midx_verify = CHILD_PROCESS_INIT;
    -+	int ret = 0;
     +
    ++	prepare_repo_settings(source->base.odb->repo);
     +	if (!source->base.odb->repo->settings.core_multi_pack_index)
     +		return 0;
     +
    @@ odb/source-packed.c: static int verify_reverse_indices(struct odb_source_packed
     +	else
     +		strvec_push(&midx_verify.args, "--no-progress");
     +	if (run_command(&midx_verify))
    -+		ret = -1;
    ++		return -1;
     +
    -+	return ret;
    ++	return 0;
     +}
     +
      static int odb_source_packed_fsck(struct odb_source *source,
10:  d140d15980 = 10:  f0f00e573a builtin/fsck: move loose object verification into the loose source

--- base-commit: 6b08999fb1b3ad0bad04d492dc206ad42839e274 change-id: 20260810-pks-odb-source-fsck-e64772c7ee5f

Previous: Karthik NayakNext: Patrick Steinhardt
Message 44 of 54 in “odb: make consistency checks pluggable”
  1. 00/10 odb: make consistency checks pluggablePatrick Steinhardt, Aug 25, 2026
  2. 01/10 builtin/fsck: use `fsck_obj_buffer()` when checking loose objectsPatrick Steinhardt, Aug 25, 2026
  3. Karthik NayakAug 27, 2026
  4. Patrick SteinhardtAug 31, 2026
  5. 02/10 builtin/fsck: merge `fsck_obj_buffer()` and `fsck_obj()`Patrick Steinhardt, Aug 25, 2026
  6. Karthik NayakAug 27, 2026
  7. Patrick SteinhardtAug 31, 2026
  8. 03/10 builtin/fsck: de-globalize option handlingPatrick Steinhardt, Aug 25, 2026
  9. Karthik NayakAug 27, 2026
  10. 04/10 builtin/fsck: don't check alternates with "--no-full"Patrick Steinhardt, Aug 25, 2026
  11. Karthik NayakAug 27, 2026
  12. Patrick SteinhardtAug 31, 2026
  13. 05/10 odb: provide infrastructure for pluggable fsck checksPatrick Steinhardt, Aug 25, 2026
  14. Karthik NayakAug 27, 2026
  15. Patrick SteinhardtAug 31, 2026
  16. 06/10 builtin/fsck: move packfile verification into the packed sourcePatrick Steinhardt, Aug 25, 2026
  17. 07/10 builtin/fsck: move reverse index verification into the packed sourcePatrick Steinhardt, Aug 25, 2026
  18. 08/10 builtin/fsck: move bitmap verification into the packed sourcePatrick Steinhardt, Aug 25, 2026
  19. Karthik NayakAug 27, 2026
  20. Patrick SteinhardtAug 31, 2026
  21. Karthik NayakAug 31, 2026
  22. 09/10 builtin/fsck: move multi-pack index verification into the packed sourcePatrick Steinhardt, Aug 25, 2026
  23. 10/10 builtin/fsck: move loose object verification into the loose sourcePatrick Steinhardt, Aug 25, 2026
  24. Karthik NayakAug 27, 2026
  25. 00/10 odb: make consistency checks pluggablePatrick Steinhardt, Aug 31, 2026
  26. 01/10 builtin/fsck: use `fsck_obj_buffer()` when checking loose objectsPatrick Steinhardt, Aug 31, 2026
  27. 02/10 builtin/fsck: merge `fsck_obj_buffer()` and `fsck_obj()`Patrick Steinhardt, Aug 31, 2026
  28. 03/10 builtin/fsck: de-globalize option handlingPatrick Steinhardt, Aug 31, 2026
  29. 04/10 builtin/fsck: don't check alternates with "--no-full"Patrick Steinhardt, Aug 31, 2026
  30. 05/10 odb: provide infrastructure for pluggable fsck checksPatrick Steinhardt, Aug 31, 2026
  31. Toon ClaesSep 11, 2026
  32. Patrick SteinhardtSep 11, 2026
  33. 06/10 builtin/fsck: move packfile verification into the packed sourcePatrick Steinhardt, Aug 31, 2026
  34. 07/10 builtin/fsck: move reverse index verification into the packed sourcePatrick Steinhardt, Aug 31, 2026
  35. Toon ClaesSep 11, 2026
  36. 08/10 builtin/fsck: move bitmap verification into the packed sourcePatrick Steinhardt, Aug 31, 2026
  37. 09/10 builtin/fsck: move multi-pack index verification into the packed sourcePatrick Steinhardt, Aug 31, 2026
  38. Toon ClaesSep 11, 2026
  39. Patrick SteinhardtSep 11, 2026
  40. 10/10 builtin/fsck: move loose object verification into the loose sourcePatrick Steinhardt, Aug 31, 2026
  41. Toon ClaesSep 11, 2026
  42. Patrick SteinhardtSep 11, 2026
  43. Karthik NayakAug 31, 2026
  44. 00/10 odb: make consistency checks pluggablePatrick Steinhardt, Sep 11, 2026
  45. 01/10 builtin/fsck: use `fsck_obj_buffer()` when checking loose objectsPatrick Steinhardt, Sep 11, 2026
  46. 02/10 builtin/fsck: merge `fsck_obj_buffer()` and `fsck_obj()`Patrick Steinhardt, Sep 11, 2026
  47. 03/10 builtin/fsck: de-globalize option handlingPatrick Steinhardt, Sep 11, 2026
  48. 04/10 builtin/fsck: don't check alternates with "--no-full"Patrick Steinhardt, Sep 11, 2026
  49. 05/10 odb: provide infrastructure for pluggable fsck checksPatrick Steinhardt, Sep 11, 2026
  50. 06/10 builtin/fsck: move packfile verification into the packed sourcePatrick Steinhardt, Sep 11, 2026
  51. 07/10 builtin/fsck: move reverse index verification into the packed sourcePatrick Steinhardt, Sep 11, 2026
  52. 08/10 builtin/fsck: move bitmap verification into the packed sourcePatrick Steinhardt, Sep 11, 2026
  53. 09/10 builtin/fsck: move multi-pack index verification into the packed sourcePatrick Steinhardt, Sep 11, 2026
  54. 10/10 builtin/fsck: move loose object verification into the loose sourcePatrick Steinhardt, Sep 11, 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.