All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] odb: write alternates at creation time
@ 2026-08-25 14:11 Patrick Steinhardt
  2026-08-25 14:11 ` [PATCH 1/8] builtin/clone: defer setup of the object database Patrick Steinhardt
                   ` (11 more replies)
  0 siblings, 12 replies; 84+ messages in thread
From: Patrick Steinhardt @ 2026-08-25 14:11 UTC (permalink / raw)
  To: git

Hi,

writing alternates into the object database currently happens via
`odb_source_write_alternate()`. But while that creates the ability to
create alternates at arbitrary points of a source's lifetime, we don't
use that functionality in the first place. Instead, we only ever write
alternates when creating a new repository.

This design is suboptimal due to a couple of reasons:

  - It requires us to have a `write_alternates()` callback, which is
    overblown as we never even write alternates to an object database
    after it has been created.

  - We're about to make alternates an implementation detail of the
    object database's backend in a future patch series, so alternate
    implementations may not even support them.

  - The backend has more flexibility with how exactly alternates are
    configured when it itself is in full control over their setup at the
    time where it creates the object database itself.

This patch series thus refactors how we handle alternates so that we
don't write them ad-hoc anymore. Instead, the series introduces a new
option for `odb_source_create_on_disk()` that makes it handle those
alternates at creation time.

This is part of the bigger goal of moving handling of alternates into
the "files" backend.

This series is built on top of 2c3adbb2c4 (The 18th batch, 2026-08-24)
with ps/odb-eagerly-load-alternates at 0076dc9f81 (odb: drop
`alternates_db` field, 2026-08-17) merged into it.

Thanks!

Patrick

---
Patrick Steinhardt (8):
      builtin/clone: defer setup of the object database
      builtin/clone: move around `setup_reference()`
      builtin/clone: refactor handling of "--reference{,-if-able}"
      builtin/clone: move setup of alternates for shared local clones
      builtin/clone: move setup of alternates for non-shared local clones
      odb/source: support writing alternates when creating the database
      builtin/clone: write alternates via `odb_create_on_disk()`
      odb/source: remove the ability to write alternates

 builtin/clone.c            | 108 ++++++++++++++++++++++++--------------
 odb.c                      |   9 ----
 odb.h                      |   7 ---
 odb/source-files.c         | 128 +++++++++++++++++++++++++--------------------
 odb/source-inmemory.c      |   7 ---
 odb/source-loose.c         |   7 ---
 odb/source-packed.c        |   7 ---
 odb/source.h               |  44 ++++++----------
 setup.c                    |  15 ++++--
 setup.h                    |  15 ++++--
 t/t5604-clone-reference.sh |  25 +++++++++
 11 files changed, 201 insertions(+), 171 deletions(-)


---
base-commit: afa255aeb620346d56a2c01fb5ae9163513c56d7
change-id: 20260813-pks-odb-write-alternates-at-creation-time-64010deb94a0


^ permalink raw reply	[flat|nested] 84+ messages in thread

end of thread, other threads:[~2026-09-11  5:15 UTC | newest]

Thread overview: 84+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25 14:11 [PATCH 0/8] odb: write alternates at creation time Patrick Steinhardt
2026-08-25 14:11 ` [PATCH 1/8] builtin/clone: defer setup of the object database Patrick Steinhardt
2026-08-25 14:11 ` [PATCH 2/8] builtin/clone: move around `setup_reference()` Patrick Steinhardt
2026-08-25 14:11 ` [PATCH 3/8] builtin/clone: refactor handling of "--reference{,-if-able}" Patrick Steinhardt
2026-08-28 14:52   ` Toon Claes
2026-08-25 14:11 ` [PATCH 4/8] builtin/clone: move setup of alternates for shared local clones Patrick Steinhardt
2026-08-28 14:52   ` Toon Claes
2026-08-25 14:11 ` [PATCH 5/8] builtin/clone: move setup of alternates for non-shared " Patrick Steinhardt
2026-08-28 14:52   ` Toon Claes
2026-08-31  8:13     ` Patrick Steinhardt
2026-08-25 14:11 ` [PATCH 6/8] odb/source: support writing alternates when creating the database Patrick Steinhardt
2026-08-28 14:53   ` Toon Claes
2026-08-31  8:14     ` Patrick Steinhardt
2026-08-28 19:13   ` Junio C Hamano
2026-08-31  8:14     ` Patrick Steinhardt
2026-08-25 14:11 ` [PATCH 7/8] builtin/clone: write alternates via `odb_create_on_disk()` Patrick Steinhardt
2026-08-25 14:11 ` [PATCH 8/8] odb/source: remove the ability to write alternates Patrick Steinhardt
2026-08-28 14:53   ` Toon Claes
2026-08-31  8:14     ` Patrick Steinhardt
2026-08-31 10:02 ` [PATCH v2 0/8] odb: write alternates at creation time Patrick Steinhardt
2026-08-31 10:02   ` [PATCH v2 1/8] builtin/clone: defer setup of the object database Patrick Steinhardt
2026-09-06 16:42     ` Justin Tobler
2026-09-07  7:23       ` Patrick Steinhardt
2026-08-31 10:02   ` [PATCH v2 2/8] builtin/clone: move around `setup_reference()` Patrick Steinhardt
2026-08-31 10:02   ` [PATCH v2 3/8] builtin/clone: refactor handling of "--reference{,-if-able}" Patrick Steinhardt
2026-08-31 10:02   ` [PATCH v2 4/8] builtin/clone: move setup of alternates for shared local clones Patrick Steinhardt
2026-08-31 10:02   ` [PATCH v2 5/8] builtin/clone: move setup of alternates for non-shared " Patrick Steinhardt
2026-08-31 10:02   ` [PATCH v2 6/8] odb/source: support writing alternates when creating the database Patrick Steinhardt
2026-09-06 17:02     ` Justin Tobler
2026-09-07  7:23       ` Patrick Steinhardt
2026-08-31 10:02   ` [PATCH v2 7/8] builtin/clone: write alternates via `odb_create_on_disk()` Patrick Steinhardt
2026-09-06 17:07     ` Justin Tobler
2026-08-31 10:02   ` [PATCH v2 8/8] odb/source: remove the ability to write alternates Patrick Steinhardt
2026-09-01  6:09   ` [PATCH v2 0/8] odb: write alternates at creation time Toon Claes
2026-09-07  8:25 ` [PATCH v3 0/9] " Patrick Steinhardt
2026-09-07  8:25   ` [PATCH v3 1/9] setup: split up concerns of `init_db()` Patrick Steinhardt
2026-09-08 22:12     ` Justin Tobler
2026-09-09  5:48       ` Patrick Steinhardt
2026-09-07  8:25   ` [PATCH v3 2/9] builtin/clone: defer setup of the object database Patrick Steinhardt
2026-09-08 22:20     ` Justin Tobler
2026-09-09  5:48       ` Patrick Steinhardt
2026-09-07  8:25   ` [PATCH v3 3/9] builtin/clone: move around `setup_reference()` Patrick Steinhardt
2026-09-07  8:25   ` [PATCH v3 4/9] builtin/clone: refactor handling of "--reference{,-if-able}" Patrick Steinhardt
2026-09-07  8:25   ` [PATCH v3 5/9] builtin/clone: move setup of alternates for shared local clones Patrick Steinhardt
2026-09-08 22:43     ` Justin Tobler
2026-09-08 22:48       ` Justin Tobler
2026-09-07  8:25   ` [PATCH v3 6/9] builtin/clone: move setup of alternates for non-shared " Patrick Steinhardt
2026-09-07  8:25   ` [PATCH v3 7/9] odb/source: support writing alternates when creating the database Patrick Steinhardt
2026-09-07  8:25   ` [PATCH v3 8/9] builtin/clone: write alternates via `odb_create_on_disk()` Patrick Steinhardt
2026-09-07  8:25   ` [PATCH v3 9/9] odb/source: remove the ability to write alternates Patrick Steinhardt
2026-09-09  5:48 ` [PATCH v4 0/9] odb: write alternates at creation time Patrick Steinhardt
2026-09-09  5:48   ` [PATCH v4 1/9] setup: split up concerns of `init_db()` Patrick Steinhardt
2026-09-10  9:24     ` Karthik Nayak
2026-09-09  5:48   ` [PATCH v4 2/9] builtin/clone: defer setup of the object database Patrick Steinhardt
2026-09-10  9:28     ` Karthik Nayak
2026-09-09  5:48   ` [PATCH v4 3/9] builtin/clone: move around `setup_reference()` Patrick Steinhardt
2026-09-10  9:29     ` Karthik Nayak
2026-09-09  5:48   ` [PATCH v4 4/9] builtin/clone: refactor handling of "--reference{,-if-able}" Patrick Steinhardt
2026-09-10  9:37     ` Karthik Nayak
2026-09-10 14:26       ` Patrick Steinhardt
2026-09-09  5:48   ` [PATCH v4 5/9] builtin/clone: move setup of alternates for shared local clones Patrick Steinhardt
2026-09-10 10:52     ` Karthik Nayak
2026-09-10 10:54       ` Karthik Nayak
2026-09-10 14:26         ` Patrick Steinhardt
2026-09-09  5:48   ` [PATCH v4 6/9] builtin/clone: move setup of alternates for non-shared " Patrick Steinhardt
2026-09-10 11:00     ` Karthik Nayak
2026-09-09  5:48   ` [PATCH v4 7/9] odb/source: support writing alternates when creating the database Patrick Steinhardt
2026-09-10 11:10     ` Karthik Nayak
2026-09-11  5:15       ` Patrick Steinhardt
2026-09-09  5:48   ` [PATCH v4 8/9] builtin/clone: write alternates via `odb_create_on_disk()` Patrick Steinhardt
2026-09-09  5:48   ` [PATCH v4 9/9] odb/source: remove the ability to write alternates Patrick Steinhardt
2026-09-09 18:30   ` [PATCH v4 0/9] odb: write alternates at creation time Justin Tobler
2026-09-10 15:09 ` [PATCH v5 " Patrick Steinhardt
2026-09-10 15:09   ` [PATCH v5 1/9] setup: split up concerns of `init_db()` Patrick Steinhardt
2026-09-10 15:09   ` [PATCH v5 2/9] builtin/clone: defer setup of the object database Patrick Steinhardt
2026-09-10 15:09   ` [PATCH v5 3/9] builtin/clone: move around `setup_reference()` Patrick Steinhardt
2026-09-10 15:09   ` [PATCH v5 4/9] builtin/clone: refactor handling of "--reference{,-if-able}" Patrick Steinhardt
2026-09-10 15:09   ` [PATCH v5 5/9] builtin/clone: move setup of alternates for shared local clones Patrick Steinhardt
2026-09-10 15:09   ` [PATCH v5 6/9] builtin/clone: move setup of alternates for non-shared " Patrick Steinhardt
2026-09-10 15:09   ` [PATCH v5 7/9] odb/source: support writing alternates when creating the database Patrick Steinhardt
2026-09-10 15:09   ` [PATCH v5 8/9] builtin/clone: write alternates via `odb_create_on_disk()` Patrick Steinhardt
2026-09-10 15:09   ` [PATCH v5 9/9] odb/source: remove the ability to write alternates Patrick Steinhardt
2026-09-10 19:53   ` [PATCH v5 0/9] odb: write alternates at creation time Karthik Nayak
2026-09-11  5:15     ` Patrick Steinhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.