Git development
 help / color / mirror / Atom feed
From: Edson <edsonwasswa54@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Edson <edsonwasswa54@gmail.com>
Subject: [PATCH] doc: document two-pass promisor remote fetch order
Date: Tue, 27 Oct 2026 00:12:10 +0300	[thread overview]
Message-ID: <20261026211210.1941-1-edsonwasswa54@gmail.com> (raw)

The "Using many promisor remotes" section in the partial-clone design
documentation describes how promisor remotes are configured and the order
in which they are tried. However, it does not mention that servers can
advertise promisor remotes via the protocol v2 "promisor-remote"
capability, and that such server-accepted remotes are tried before other
configured promisor remotes.

The implementation uses a two-pass approach: first try accepted remotes
(those advertised by the server and accepted by the client), then try
all configured promisor remotes. Document this behavior to make the
technical design notes complete.

This patch also clarifies the security model for server-advertised promisor
remotes. Advertising a remote does not, by itself, make the client accept
or trust it. By default, clients reject all server-advertised promisor
remotes (the promisor.acceptFromServer default is "none"). A client only
accepts an advertised remote when the user explicitly configures an
acceptance policy via promisor.acceptFromServer or promisor.acceptFromServerUrl.
This prevents servers from arbitrarily directing clients to fetch from
untrusted repositories, addressing the concern that a server might inject
a brand-new, untrusted promisor remote configuration.

Reference the gitprotocol-v2 documentation for protocol details rather
than duplicating the information.

Signed-off-by: Edson <edsonwasswa54@gmail.com>
---
 Documentation/technical/partial-clone.adoc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/technical/partial-clone.adoc b/Documentation/technical/partial-clone.adoc
index a1104930fb..f80346729b 100644
--- a/Documentation/technical/partial-clone.adoc
+++ b/Documentation/technical/partial-clone.adoc
@@ -199,6 +199,10 @@ until all the objects have been fetched.
 When a server advertises promisor remotes via the protocol v2
 "promisor-remote" capability and the client accepts them (see
 linkgit:gitprotocol-v2[5]), those accepted remotes are tried first.
+Note that clients only accept server-advertised promisor remotes when
+explicitly configured to do so via the `promisor.acceptFromServer` or
+`promisor.acceptFromServerUrl` options (see linkgit:git-config[1]),
+which prevents arbitrary injection of untrusted remotes by servers.
 After trying the accepted remotes, Git then tries the other configured
 promisor remotes as described below.
 
-- 
2.46.0.windows.1


             reply	other threads:[~2026-10-26 21:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 21:12 Edson [this message]
2026-10-27  0:34 ` [PATCH] doc: document two-pass promisor remote fetch order Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2026-10-28  9:17 Edson

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=20261026211210.1941-1-edsonwasswa54@gmail.com \
    --to=edsonwasswa54@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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