From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 01/12] cache-tree: remove dependency on `the_repository`
Date: Tue, 01 Sep 2026 15:47:04 -0700 [thread overview]
Message-ID: <xmqqmru0lhcn.fsf@gitster.g> (raw)
In-Reply-To: <20260901-pks-odb-registering-in-memory-sources-v1-1-97a312d5fa25@pks.im> (Patrick Steinhardt's message of "Tue, 01 Sep 2026 13:09:00 +0200")
Patrick Steinhardt <ps@pks.im> writes:
> diff --git a/cache-tree.c b/cache-tree.c
> index a220372a42..6e4d82f3e8 100644
> --- a/cache-tree.c
> +++ b/cache-tree.c
> ...
> @@ -775,7 +781,7 @@ struct tree *write_in_core_index_as_tree(struct repository *repo,
> int was_valid, ret;
>
> was_valid = index_state->cache_tree &&
> - cache_tree_fully_valid(index_state->cache_tree);
> + cache_tree_fully_valid(repo, index_state->cache_tree);
Here you use "repo". I do not know offhand if the two callers of
this function write_in_core_index_as_tree() are correct (they are in
builtin/history.c and not my code), but if they are, then "repo"
should match "index_state->repo". And if they aren't, this code is
broken.
Either way, passing index_state->repo would be the right thing to do
here. Perhaps write_in_core_index_as_tree() should be corrected to
drop its "repo" parameter.
> diff --git a/unpack-trees.c b/unpack-trees.c
> index 154d6d40a1..20e6d6d824 100644
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> ...
> @@ -2086,7 +2087,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
> }
>
> if (!o->skip_cache_tree_update &&
> - !cache_tree_fully_valid(o->internal.result.cache_tree))
> + !cache_tree_fully_valid(the_repository, o->internal.result.cache_tree))
The o->internal.result is a full fledged istate instance and comes
with its own repository. It may or may not be the same as
the_repository.
If this were a misconversion, it would argue strongly for a thin
wrapper I suggested in the other message, that only takes an istate
instance and infers which repository and which cache-tree to work
with.
next prev parent reply other threads:[~2026-09-01 22:47 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 11:08 [PATCH 00/12] odb: stop registering in-memory sources Patrick Steinhardt
2026-09-01 11:09 ` [PATCH 01/12] cache-tree: remove dependency on `the_repository` Patrick Steinhardt
2026-09-01 22:03 ` Junio C Hamano
2026-09-02 10:23 ` Patrick Steinhardt
2026-09-01 22:47 ` Junio C Hamano [this message]
2026-09-01 11:09 ` [PATCH 02/12] submodule-config: remove uses of `the_repository` Patrick Steinhardt
2026-09-01 11:09 ` [PATCH 03/12] submodule-config: stop using `the_hash_algo` Patrick Steinhardt
2026-09-01 11:09 ` [PATCH 04/12] submodule-config: stop registering submodule sources Patrick Steinhardt
2026-09-01 11:09 ` [PATCH 05/12] builtin/grep: stop registering submodule ODB as source Patrick Steinhardt
2026-09-01 11:09 ` [PATCH 06/12] odb: remove infrastructure to register submodule sources Patrick Steinhardt
2026-09-01 22:26 ` Junio C Hamano
2026-09-01 11:09 ` [PATCH 07/12] tmp-objdir: drop unused function to register alternate Patrick Steinhardt
2026-09-01 11:09 ` [PATCH 08/12] odb/packed: fix memory leaks when freeing source Patrick Steinhardt
2026-09-01 11:09 ` [PATCH 09/12] builtin/multi-pack-index: refuse unknown sources with "--object-dir=" Patrick Steinhardt
2026-09-01 11:09 ` [PATCH 10/12] t/helper: adapt read-midx to not link ad-hoc source anymore Patrick Steinhardt
2026-09-01 11:09 ` [PATCH 11/12] t/helper: stop registering alternates in "ref-store" command Patrick Steinhardt
2026-09-01 11:09 ` [PATCH 12/12] odb: remove the ability to link sources ad-hoc Patrick Steinhardt
2026-09-02 13:34 ` [PATCH v2 00/13] odb: stop registering in-memory sources Patrick Steinhardt
2026-09-02 13:34 ` [PATCH v2 01/13] cache-tree: drop `the_repository` in `cache_tree_fully_valid()` Patrick Steinhardt
2026-09-02 13:34 ` [PATCH v2 02/13] cache-tree: remove dependency on `the_repository` Patrick Steinhardt
2026-09-04 22:28 ` Karthik Nayak
2026-09-07 7:49 ` Patrick Steinhardt
2026-09-02 13:34 ` [PATCH v2 03/13] submodule-config: remove uses of `the_repository` Patrick Steinhardt
2026-09-02 13:34 ` [PATCH v2 04/13] submodule-config: stop using `the_hash_algo` Patrick Steinhardt
2026-09-02 13:34 ` [PATCH v2 05/13] submodule-config: stop registering submodule sources Patrick Steinhardt
2026-09-06 18:38 ` Justin Tobler
2026-09-07 7:50 ` Patrick Steinhardt
2026-09-08 23:04 ` Justin Tobler
2026-09-09 5:52 ` Patrick Steinhardt
2026-09-02 13:34 ` [PATCH v2 06/13] builtin/grep: stop registering submodule ODB as source Patrick Steinhardt
2026-09-02 13:34 ` [PATCH v2 07/13] odb: remove infrastructure to register submodule sources Patrick Steinhardt
2026-09-04 22:36 ` Karthik Nayak
2026-09-02 13:34 ` [PATCH v2 08/13] tmp-objdir: drop unused function to register alternate Patrick Steinhardt
2026-09-02 13:34 ` [PATCH v2 09/13] odb/packed: fix memory leaks when freeing source Patrick Steinhardt
2026-09-02 13:34 ` [PATCH v2 10/13] builtin/multi-pack-index: refuse unknown sources with "--object-dir=" Patrick Steinhardt
2026-09-08 23:12 ` Justin Tobler
2026-09-02 13:34 ` [PATCH v2 11/13] t/helper: adapt read-midx to not link ad-hoc source anymore Patrick Steinhardt
2026-09-02 13:35 ` [PATCH v2 12/13] t/helper: stop registering alternates in "ref-store" command Patrick Steinhardt
2026-09-02 13:35 ` [PATCH v2 13/13] odb: remove the ability to link sources ad-hoc Patrick Steinhardt
2026-09-04 22:45 ` [PATCH v2 00/13] odb: stop registering in-memory sources Karthik Nayak
2026-09-11 5:51 ` [PATCH v3 " Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 01/13] cache-tree: drop `the_repository` in `cache_tree_fully_valid()` Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 02/13] cache-tree: remove dependency on `the_repository` Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 03/13] submodule-config: remove uses of `the_repository` Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 04/13] submodule-config: stop using `the_hash_algo` Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 05/13] submodule-config: stop registering submodule sources Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 06/13] builtin/grep: stop registering submodule ODB as source Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 07/13] odb: remove infrastructure to register submodule sources Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 08/13] tmp-objdir: drop unused function to register alternate Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 09/13] odb/packed: fix memory leaks when freeing source Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 10/13] builtin/multi-pack-index: refuse unknown sources with "--object-dir=" Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 11/13] t/helper: adapt read-midx to not link ad-hoc source anymore Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 12/13] t/helper: stop registering alternates in "ref-store" command Patrick Steinhardt
2026-09-11 5:51 ` [PATCH v3 13/13] odb: remove the ability to link sources ad-hoc Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqmru0lhcn.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox