From: Junio C Hamano <gitster@pobox.com>
To: "Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Kristofer Karlsson <krka@spotify.com>,
Patrick Steinhardt <ps@pks.im>
Subject: Re: [PATCH v4 5/6] connected: add incremental connectivity check via rev-list
Date: Wed, 21 Oct 2026 13:18:40 -0700 [thread overview]
Message-ID: <xmqqecdin6xr.fsf@gitster.g> (raw)
In-Reply-To: <d76dae801b3303ef4271f71c7b3999c10cac8556.1792581744.git.gitgitgadget@gmail.com> (Kristofer Karlsson via GitGitGadget's message of "Wed, 21 Oct 2026 11:22:23 +0000")
"Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> -static void parse_connectivity_check(struct repository *repo UNUSED,
> +static void parse_connectivity_check(struct repository *repo,
> const char *arg,
> struct connectivity_check *check)
> {
> if (!strcmp(arg, "full"))
> check->mode = CONNECTIVITY_CHECK_FULL;
> + else if (!strcmp(arg, "incremental"))
> + check->mode = CONNECTIVITY_CHECK_INCREMENTAL;
> else
> die(_("unknown --connectivity-check mode '%s'"), arg);
> +
> + if (check->mode != CONNECTIVITY_CHECK_FULL)
> + repo->fetch_if_missing = 0;
> }
This assumes that everybody that is different from full want to
avoid lazy fetching. It may be true right now as you have only full
and incremental, but it somehow feels like a trap waiting to bite
future developers.
> @@ -992,6 +999,29 @@ int cmd_rev_list(int argc,
>
> prepare_maximal_independent(&revs);
>
> + /*
> + * Without a boundary of negative revisions, as in a clone or a
> + * push into an empty repository, every incoming commit is new.
> + * The incremental check would still work, but it would verify
> + * the whole object graph like the full check, with extra
> + * per-commit overhead on top, so use the full check.
> + */
> + if (!revs.limited)
> + connectivity_check.mode = CONNECTIVITY_CHECK_FULL;
> +
> + if (connectivity_check.mode == CONNECTIVITY_CHECK_INCREMENTAL) {
> + struct commit *commit;
> + struct commit_list *new_commits = NULL;
> +
> + while ((commit = get_revision(&revs)) != NULL)
> + commit_list_insert(commit, &new_commits);
> +
> + if (verify_commits_incremental(repo, &new_commits,
> + revs.exclude_promisor_objects))
> + die(_("connectivity check failed"));
> + commit_list_free(new_commits);
> + }
> +
We only call verify_commits_incremental() when check.mode says INCREMENTAL,
which makes sense.
> +static int verify_blob(struct repository *repo,
> + const struct object_id *oid,
> + struct verify_state *vs)
> +{
> + int type;
> +
> + if (oidset_contains(&vs->trusted_blobs, oid))
> + return 0;
> +
> + vs->blobs_checked++;
> + type = odb_read_object_info(repo->objects, oid, NULL);
I wonder if this needs to be _extended() kind that passes a flag bit
to avoid fetching from promisors. repo->fetch_if_missing that is
set does prevent lazy fetching, but I wonder if it is better to be
more explicit.
> +int verify_commits_incremental(struct repository *repo,
> + struct commit_list **commits,
> + int exclude_promisor_objects)
> +{
> + struct verify_state vs = { 0 };
> + struct commit_list *iter;
> + unsigned nr_before;
> + int ret = 0;
> +
> + if (repo->fetch_if_missing)
> + BUG("verify_commits_incremental must not be called "
> + "with fetch_if_missing set");
And we make sure that the caller flipped the bit before they decide
to call us, which makes sense.
next prev parent reply other threads:[~2026-10-21 20:18 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 9:47 [PATCH 0/2] connected: add incremental connectivity check Kristofer Karlsson via GitGitGadget
2026-09-14 9:47 ` [PATCH 1/2] Documentation: describe connectivity checking Kristofer Karlsson via GitGitGadget
2026-09-14 9:47 ` [PATCH 2/2] connected: add incremental connectivity check via rev-list Kristofer Karlsson via GitGitGadget
2026-09-14 15:26 ` Junio C Hamano
2026-09-14 17:46 ` Kristofer Karlsson
2026-09-14 15:12 ` [PATCH 0/2] connected: add incremental connectivity check Junio C Hamano
2026-09-28 13:02 ` [PATCH v2 " Kristofer Karlsson via GitGitGadget
2026-09-28 13:02 ` [PATCH v2 1/2] Documentation: describe connectivity checking Kristofer Karlsson via GitGitGadget
2026-10-05 7:59 ` Patrick Steinhardt
2026-10-05 19:17 ` Junio C Hamano
2026-10-06 5:59 ` Patrick Steinhardt
2026-10-06 10:03 ` Kristofer Karlsson
2026-10-06 10:12 ` Kristofer Karlsson
2026-09-28 13:02 ` [PATCH v2 2/2] connected: add incremental connectivity check via rev-list Kristofer Karlsson via GitGitGadget
2026-10-05 8:00 ` Patrick Steinhardt
2026-10-06 10:37 ` Kristofer Karlsson
2026-10-06 12:08 ` Patrick Steinhardt
2026-10-06 12:36 ` Kristofer Karlsson
2026-10-12 12:07 ` [PATCH v3 0/4] connected: add incremental connectivity check Kristofer Karlsson via GitGitGadget
2026-10-12 12:07 ` [PATCH v3 1/4] Documentation: describe connectivity checking Kristofer Karlsson via GitGitGadget
2026-10-15 6:55 ` Patrick Steinhardt
2026-10-15 9:12 ` Kristofer Karlsson
2026-10-12 12:07 ` [PATCH v3 2/4] p5413: add perf tests for connectivity check Kristofer Karlsson via GitGitGadget
2026-10-15 6:55 ` Patrick Steinhardt
2026-10-15 9:14 ` Kristofer Karlsson
2026-10-12 12:07 ` [PATCH v3 3/4] connected: add transfer.connectivityCheck config and rev-list flag Kristofer Karlsson via GitGitGadget
2026-10-12 18:49 ` Junio C Hamano
2026-10-13 7:41 ` Kristofer Karlsson
2026-10-13 13:46 ` Junio C Hamano
2026-10-15 6:55 ` Patrick Steinhardt
2026-10-15 9:53 ` Kristofer Karlsson
2026-10-12 12:07 ` [PATCH v3 4/4] connected: add incremental connectivity check via rev-list Kristofer Karlsson via GitGitGadget
2026-10-15 6:55 ` Patrick Steinhardt
2026-10-15 9:51 ` Kristofer Karlsson
2026-10-15 11:50 ` Patrick Steinhardt
2026-10-16 11:50 ` Kristofer Karlsson
2026-10-19 7:30 ` Patrick Steinhardt
2026-10-12 18:55 ` [PATCH v3 0/4] connected: add incremental connectivity check Junio C Hamano
2026-10-13 7:54 ` Kristofer Karlsson
2026-10-21 11:22 ` [PATCH v4 0/6] " Kristofer Karlsson via GitGitGadget
2026-10-21 11:22 ` [PATCH v4 1/6] Documentation: describe connectivity checking Kristofer Karlsson via GitGitGadget
2026-10-21 11:22 ` [PATCH v4 2/6] p5413: add perf tests for connectivity check Kristofer Karlsson via GitGitGadget
2026-10-21 11:22 ` [PATCH v4 3/6] connected: drop dependency on `the_repository` Kristofer Karlsson via GitGitGadget
2026-10-21 11:22 ` [PATCH v4 4/6] connected: add transfer.connectivityCheck config Kristofer Karlsson via GitGitGadget
2026-10-21 11:22 ` [PATCH v4 5/6] connected: add incremental connectivity check via rev-list Kristofer Karlsson via GitGitGadget
2026-10-21 20:18 ` Junio C Hamano [this message]
2026-10-22 7:00 ` Kristofer Karlsson
2026-10-22 8:35 ` Kristofer Karlsson
2026-10-22 14:46 ` Junio C Hamano
2026-10-22 16:11 ` Kristofer Karlsson
2026-10-23 17:58 ` Junio C Hamano
2026-10-21 11:22 ` [PATCH v4 6/6] connected: add "auto" connectivity check mode Kristofer Karlsson via GitGitGadget
2026-10-23 13:11 ` [PATCH v5 0/6] connected: add incremental connectivity check Kristofer Karlsson via GitGitGadget
2026-10-23 13:11 ` [PATCH v5 1/6] Documentation: describe connectivity checking Kristofer Karlsson via GitGitGadget
2026-10-23 13:11 ` [PATCH v5 2/6] p5413: add perf tests for connectivity check Kristofer Karlsson via GitGitGadget
2026-10-23 13:11 ` [PATCH v5 3/6] connected: drop dependency on `the_repository` Kristofer Karlsson via GitGitGadget
2026-10-23 13:11 ` [PATCH v5 4/6] connected: add transfer.connectivityCheck config Kristofer Karlsson via GitGitGadget
2026-10-23 13:11 ` [PATCH v5 5/6] connected: add incremental connectivity check via rev-list Kristofer Karlsson via GitGitGadget
2026-10-23 13:11 ` [PATCH v5 6/6] connected: add "auto" connectivity check mode Kristofer Karlsson via GitGitGadget
2026-10-23 18:52 ` [PATCH v5 0/6] connected: add incremental connectivity check Junio C Hamano
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=xmqqecdin6xr.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=krka@spotify.com \
--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