Re: [PATCH v2 0/8] odb: write alternates at creation time Patrick Steinhardt <ps@pks.im> writes: Show 38 quoted lines > 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.
>
> Changes in v2:
> - Use a lockfile to write "info/alternates" during creation time.
> - Remove useless "strvec.h" include by reordering declarations a bit.
> - Link to v1: https://patch.msgid.link/20260825-pks-odb-write-alternates-at-creation-time-v1-0-911513ba95c3@pks.im This version looks good to me! --
Laters,
Toon Message 29 of 85 in “odb: write alternates at creation time” 0/8 odb: write alternates at creation timePatrick Steinhardt, Aug 25, 2026 1/8 builtin/clone: defer setup of the object databasePatrick Steinhardt, Aug 25, 2026 2/8 builtin/clone: move around `setup_reference()`Patrick Steinhardt, Aug 25, 2026 3/8 builtin/clone: refactor handling of "--reference{,-if-able}"Patrick Steinhardt, Aug 25, 2026 4/8 builtin/clone: move setup of alternates for shared local clonesPatrick Steinhardt, Aug 25, 2026 5/8 builtin/clone: move setup of alternates for non-shared local clonesPatrick Steinhardt, Aug 25, 2026 6/8 odb/source: support writing alternates when creating the databasePatrick Steinhardt, Aug 25, 2026 7/8 builtin/clone: write alternates via `odb_create_on_disk()`Patrick Steinhardt, Aug 25, 2026 8/8 odb/source: remove the ability to write alternatesPatrick Steinhardt, Aug 25, 2026 Toon Claes Aug 28, 2026 Toon Claes Aug 28, 2026 Toon Claes Aug 28, 2026 Toon Claes Aug 28, 2026 Toon Claes Aug 28, 2026 Junio C Hamano Aug 28, 2026 Patrick Steinhardt Aug 31, 2026 Patrick Steinhardt Aug 31, 2026 Patrick Steinhardt Aug 31, 2026 Patrick Steinhardt Aug 31, 2026 0/8 odb: write alternates at creation timePatrick Steinhardt, Aug 31, 2026 1/8 builtin/clone: defer setup of the object databasePatrick Steinhardt, Aug 31, 2026 2/8 builtin/clone: move around `setup_reference()`Patrick Steinhardt, Aug 31, 2026 3/8 builtin/clone: refactor handling of "--reference{,-if-able}"Patrick Steinhardt, Aug 31, 2026 4/8 builtin/clone: move setup of alternates for shared local clonesPatrick Steinhardt, Aug 31, 2026 5/8 builtin/clone: move setup of alternates for non-shared local clonesPatrick Steinhardt, Aug 31, 2026 6/8 odb/source: support writing alternates when creating the databasePatrick Steinhardt, Aug 31, 2026 7/8 builtin/clone: write alternates via `odb_create_on_disk()`Patrick Steinhardt, Aug 31, 2026 8/8 odb/source: remove the ability to write alternatesPatrick Steinhardt, Aug 31, 2026 Toon Claes Sep 1, 2026 Justin Tobler Sep 6, 2026 Justin Tobler Sep 6, 2026 Justin Tobler Sep 6, 2026 Patrick Steinhardt Sep 7, 2026 Patrick Steinhardt Sep 7, 2026 0/9 odb: write alternates at creation timePatrick Steinhardt, Sep 7, 2026 1/9 setup: split up concerns of `init_db()`Patrick Steinhardt, Sep 7, 2026 2/9 builtin/clone: defer setup of the object databasePatrick Steinhardt, Sep 7, 2026 3/9 builtin/clone: move around `setup_reference()`Patrick Steinhardt, Sep 7, 2026 4/9 builtin/clone: refactor handling of "--reference{,-if-able}"Patrick Steinhardt, Sep 7, 2026 5/9 builtin/clone: move setup of alternates for shared local clonesPatrick Steinhardt, Sep 7, 2026 6/9 builtin/clone: move setup of alternates for non-shared local clonesPatrick Steinhardt, Sep 7, 2026 7/9 odb/source: support writing alternates when creating the databasePatrick Steinhardt, Sep 7, 2026 8/9 builtin/clone: write alternates via `odb_create_on_disk()`Patrick Steinhardt, Sep 7, 2026 9/9 odb/source: remove the ability to write alternatesPatrick Steinhardt, Sep 7, 2026 Justin Tobler Sep 8, 2026 Justin Tobler Sep 8, 2026 Justin Tobler Sep 8, 2026 Justin Tobler Sep 8, 2026 Patrick Steinhardt Sep 9, 2026 Patrick Steinhardt Sep 9, 2026 0/9 odb: write alternates at creation timePatrick Steinhardt, Sep 9, 2026 1/9 setup: split up concerns of `init_db()`Patrick Steinhardt, Sep 9, 2026 2/9 builtin/clone: defer setup of the object databasePatrick Steinhardt, Sep 9, 2026 3/9 builtin/clone: move around `setup_reference()`Patrick Steinhardt, Sep 9, 2026 4/9 builtin/clone: refactor handling of "--reference{,-if-able}"Patrick Steinhardt, Sep 9, 2026 5/9 builtin/clone: move setup of alternates for shared local clonesPatrick Steinhardt, Sep 9, 2026 6/9 builtin/clone: move setup of alternates for non-shared local clonesPatrick Steinhardt, Sep 9, 2026 7/9 odb/source: support writing alternates when creating the databasePatrick Steinhardt, Sep 9, 2026 8/9 builtin/clone: write alternates via `odb_create_on_disk()`Patrick Steinhardt, Sep 9, 2026 9/9 odb/source: remove the ability to write alternatesPatrick Steinhardt, Sep 9, 2026 Justin Tobler Sep 9, 2026 Karthik Nayak Sep 10, 2026 Karthik Nayak Sep 10, 2026 Karthik Nayak Sep 10, 2026 Karthik Nayak Sep 10, 2026 Karthik Nayak Sep 10, 2026 Karthik Nayak Sep 10, 2026 Karthik Nayak Sep 10, 2026 Karthik Nayak Sep 10, 2026 Patrick Steinhardt Sep 10, 2026 Patrick Steinhardt Sep 10, 2026 0/9 odb: write alternates at creation timePatrick Steinhardt, Sep 10, 2026 1/9 setup: split up concerns of `init_db()`Patrick Steinhardt, Sep 10, 2026 2/9 builtin/clone: defer setup of the object databasePatrick Steinhardt, Sep 10, 2026 3/9 builtin/clone: move around `setup_reference()`Patrick Steinhardt, Sep 10, 2026 4/9 builtin/clone: refactor handling of "--reference{,-if-able}"Patrick Steinhardt, Sep 10, 2026 5/9 builtin/clone: move setup of alternates for shared local clonesPatrick Steinhardt, Sep 10, 2026 6/9 builtin/clone: move setup of alternates for non-shared local clonesPatrick Steinhardt, Sep 10, 2026 7/9 odb/source: support writing alternates when creating the databasePatrick Steinhardt, Sep 10, 2026 8/9 builtin/clone: write alternates via `odb_create_on_disk()`Patrick Steinhardt, Sep 10, 2026 9/9 odb/source: remove the ability to write alternatesPatrick Steinhardt, Sep 10, 2026 Karthik Nayak Sep 10, 2026 Patrick Steinhardt Sep 11, 2026 Patrick Steinhardt Sep 11, 2026 Karthik Nayak Sep 14, 2026 Read the whole thread , see it on lore , or plain text .