From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git@vger.kernel.org,
"brian m . carlson" <sandals@crustytoothpaste.net>,
Patrick Steinhardt <ps@pks.im>,
Karthik Nayak <karthik.188@gmail.com>,
Jeff King <peff@peff.net>, Elijah Newren <newren@gmail.com>
Subject: Re: [PATCH v2 5/5] builtin/upload-pack: set GIT_NO_LAZY_FETCH to 0 on trusted repo
Date: Fri, 14 Aug 2026 12:35:37 -0700 [thread overview]
Message-ID: <xmqq1pc0mr5i.fsf@gitster.g> (raw)
In-Reply-To: <20260813154748.2378747-6-christian.couder@gmail.com> (Christian Couder's message of "Thu, 13 Aug 2026 17:47:48 +0200")
Christian Couder <christian.couder@gmail.com> writes:
> diff --git a/Documentation/config/uploadpack.adoc b/Documentation/config/uploadpack.adoc
> index 0e1dda944a..e960879c16 100644
> --- a/Documentation/config/uploadpack.adoc
> +++ b/Documentation/config/uploadpack.adoc
> @@ -86,3 +86,45 @@ uploadpack.allowRefInWant::
> is intended for the benefit of load-balanced servers which may
> not have the same view of what OIDs their refs point to due to
> replication delay.
> +
> +uploadpack.lazyFetchTrusted::
> + These config entries specify repositories that `upload-pack` is
To somebody who designed this mechanism, it may have been clear that
you are talking about multi-valued configuration variable, i.e.,
[uploadpack]
lazyFetchTrusted = repo1
lazyFetchTrusted = repo2
...
lazyFetchTrusted = repoN
but the "config entries specify repositories" can be misread to mean
[uploadpack]
lazyFetchTrusted = repo1 repo2 ... repoN
especially combined with the use of verb "list" in "Listing a
repository here tells..." we see below.
A multi-valued configuration variable, each of which names a
repository that `upload-pack` is allowed to ...
or something, perhaps. Say that upfront to make sure readers won't
waste their time wondering what the syntax is.
Also, how would one specify a repository? A URL? Remote nickname
used in
[remote "nick"] url = ...
configuration? Local directory that houses another repository?
Something else?
> + allowed to lazily fetch missing objects for. By default,
> + `upload-pack` refuses to lazily fetch (see the description of the
> + `GIT_NO_LAZY_FETCH` environment variable in
> + linkgit:git-upload-pack[1]), because doing so would run `git fetch`,
> + which may execute arbitrary commands specified in the configuration
> + and hooks of the served repository. Listing a repository here tells
> + `upload-pack` that it is trusted, so lazy fetching from the promisor
> + remotes configured in it is allowed. This is equivalent to setting
> + `GIT_NO_LAZY_FETCH` to `0` for the matching repositories. An
> + explicitly set `GIT_NO_LAZY_FETCH` takes precedence over this
> + setting.
It would be interesting to set it to point at itself. A client asks
you to serve a pack, you find some objects you yourself do not have
because you fetched lazily from the upstream, and you end up asking
you if you have that object (U+1F61B Face with Stuck-Out Tongue 😛).
> +Note that this allows lazy fetching from any promisor remote
> +configured in the served repository, not only from the promisor
> +remotes that the client accepted using the "promisor-remote" protocol
> +v2 capability (see linkgit:gitprotocol-v2[5]). The served repository
> +is trusted as a whole, including its configuration, so the promisor
> +remotes it configures are trusted too. It is the server operator's
> +responsibility to make sure that the promisor remotes of a trusted
> +repository are also trustworthy.
> ++
> +This is a multi-valued setting, i.e. you can add more than one
> +repository via `git config (--global|--system) --add`. To reset the
> +list of trusted repositories (e.g. to override any such repositories
> +specified in the system config), add a `uploadpack.lazyFetchTrusted`
a -> an before `uploadpack.lazyFetchTrusted`.
> +entry with an empty value.
prev parent reply other threads:[~2026-08-14 19:35 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 8:51 [PATCH 0/3] Introduce a 'fromAccepted' option to GIT_NO_LAZY_FETCH Christian Couder
2026-07-10 8:51 ` [PATCH 1/3] promisor-remote: factor out lazy_fetch_objects() Christian Couder
2026-07-10 8:51 ` [PATCH 2/3] promisor-remote: introduce enum allow_lazy_fetch Christian Couder
2026-07-10 8:51 ` [PATCH 3/3] promisor-remote: teach 'fromAccepted' to GIT_NO_LAZY_FETCH Christian Couder
2026-07-10 19:50 ` [PATCH 0/3] Introduce a 'fromAccepted' option " brian m. carlson
2026-07-12 9:06 ` Christian Couder
2026-08-07 13:55 ` [PATCH 0/5] Introduce 'uploadpack.lazyFetchTrusted' Christian Couder
2026-08-07 13:55 ` [PATCH 1/5] promisor-remote: factor out lazy_fetch_objects() Christian Couder
2026-08-07 13:58 ` Christian Couder
2026-08-07 13:55 ` [PATCH 2/5] setup: extract path_allowlist_apply() Christian Couder
2026-08-07 13:55 ` [PATCH 3/5] setup: add 'allow_dot' arg to path_allowlist_apply() Christian Couder
2026-08-07 13:55 ` [PATCH 4/5] upload-pack: read uploadpack.lazyFetchTrusted Christian Couder
2026-08-07 13:55 ` [PATCH 5/5] builtin/upload-pack: set GIT_NO_LAZY_FETCH to 0 on trusted repo Christian Couder
2026-08-07 18:31 ` [PATCH 0/5] Introduce 'uploadpack.lazyFetchTrusted' Junio C Hamano
2026-08-10 8:06 ` Christian Couder
2026-08-11 5:55 ` Junio C Hamano
2026-08-13 15:47 ` [PATCH v2 " Christian Couder
2026-08-13 20:31 ` Junio C Hamano
2026-08-14 16:31 ` Christian Couder
2026-08-14 16:40 ` Junio C Hamano
2026-08-13 15:47 ` [PATCH v2 1/5] promisor-remote: factor out lazy_fetch_objects() Christian Couder
2026-08-14 17:49 ` Junio C Hamano
2026-08-13 15:47 ` [PATCH v2 2/5] setup: extract path_allowlist_apply() Christian Couder
2026-08-14 17:56 ` Junio C Hamano
2026-08-13 15:47 ` [PATCH v2 3/5] setup: add 'allow_dot' arg to path_allowlist_apply() Christian Couder
2026-08-14 18:12 ` Junio C Hamano
2026-08-13 15:47 ` [PATCH v2 4/5] upload-pack: read uploadpack.lazyFetchTrusted Christian Couder
2026-08-14 18:56 ` Junio C Hamano
2026-08-13 15:47 ` [PATCH v2 5/5] builtin/upload-pack: set GIT_NO_LAZY_FETCH to 0 on trusted repo Christian Couder
2026-08-14 19:35 ` Junio C Hamano [this message]
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=xmqq1pc0mr5i.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=karthik.188@gmail.com \
--cc=newren@gmail.com \
--cc=peff@peff.net \
--cc=ps@pks.im \
--cc=sandals@crustytoothpaste.net \
/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