{"thread":{"id":"66671","subject":"[PATCH] doc: document two-pass promisor remote fetch order","startedAt":"2026-10-26T21:12:10Z","lastAt":"2026-10-27T00:34:00Z","messageCount":2,"participants":["Edson","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"556407","messageId":"20261026211210.1941-1-edsonwasswa54@gmail.com","threadId":"66671","inReplyTo":null,"subject":"[PATCH] doc: document two-pass promisor remote fetch order","fromName":"Edson","fromEmail":"edsonwasswa54@gmail.com","sentAt":"2026-10-26T21:12:10Z","receivedAt":"2026-10-26T21:12:10Z","isPatch":true,"sender":{"key":"edsonwasswa54@gmail.com","avatar":null},"body":"The \"Using many promisor remotes\" section in the partial-clone design\ndocumentation describes how promisor remotes are configured and the order\nin which they are tried. However, it does not mention that servers can\nadvertise promisor remotes via the protocol v2 \"promisor-remote\"\ncapability, and that such server-accepted remotes are tried before other\nconfigured promisor remotes.\n\nThe implementation uses a two-pass approach: first try accepted remotes\n(those advertised by the server and accepted by the client), then try\nall configured promisor remotes. Document this behavior to make the\ntechnical design notes complete.\n\nThis patch also clarifies the security model for server-advertised promisor\nremotes. Advertising a remote does not, by itself, make the client accept\nor trust it. By default, clients reject all server-advertised promisor\nremotes (the promisor.acceptFromServer default is \"none\"). A client only\naccepts an advertised remote when the user explicitly configures an\nacceptance policy via promisor.acceptFromServer or promisor.acceptFromServerUrl.\nThis prevents servers from arbitrarily directing clients to fetch from\nuntrusted repositories, addressing the concern that a server might inject\na brand-new, untrusted promisor remote configuration.\n\nReference the gitprotocol-v2 documentation for protocol details rather\nthan duplicating the information.\n\nSigned-off-by: Edson <edsonwasswa54@gmail.com>\n---\n Documentation/technical/partial-clone.adoc | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/Documentation/technical/partial-clone.adoc b/Documentation/technical/partial-clone.adoc\nindex a1104930fb..f80346729b 100644\n--- a/Documentation/technical/partial-clone.adoc\n+++ b/Documentation/technical/partial-clone.adoc\n@@ -199,6 +199,10 @@ until all the objects have been fetched.\n When a server advertises promisor remotes via the protocol v2\n \"promisor-remote\" capability and the client accepts them (see\n linkgit:gitprotocol-v2[5]), those accepted remotes are tried first.\n+Note that clients only accept server-advertised promisor remotes when\n+explicitly configured to do so via the `promisor.acceptFromServer` or\n+`promisor.acceptFromServerUrl` options (see linkgit:git-config[1]),\n+which prevents arbitrary injection of untrusted remotes by servers.\n After trying the accepted remotes, Git then tries the other configured\n promisor remotes as described below.\n \n-- \n2.46.0.windows.1\n\n\n"},{"id":"556419","messageId":"xmqq8q3knfrb.fsf@gitster.g","threadId":"66671","inReplyTo":"20261026211210.1941-1-edsonwasswa54@gmail.com","subject":"Re: [PATCH] doc: document two-pass promisor remote fetch order","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-27T00:34:00Z","receivedAt":"2026-10-27T00:34:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Edson <edsonwasswa54@gmail.com> writes:\n\n> ...\n> The implementation uses a two-pass approach: first try accepted remotes\n> (those advertised by the server and accepted by the client), then try\n> all configured promisor remotes. Document this behavior to make the\n> technical design notes complete.\n> ...\n>  Documentation/technical/partial-clone.adoc | 4 ++++\n>  1 file changed, 4 insertions(+)\n\nThe log message may accurately describe the motivation and the\nbehavior being documented, but the patch itself appears to be\nmalformed or based on an unpublished tree.\n\n> diff --git a/Documentation/technical/partial-clone.adoc b/Documentation/technical/partial-clone.adoc\n> index a1104930fb..f80346729b 100644\n> --- a/Documentation/technical/partial-clone.adoc\n> +++ b/Documentation/technical/partial-clone.adoc\n> @@ -199,6 +199,10 @@ until all the objects have been fetched.\n>  When a server advertises promisor remotes via the protocol v2\n>  \"promisor-remote\" capability and the client accepts them (see\n>  linkgit:gitprotocol-v2[5]), those accepted remotes are tried first.\n> +Note that clients only accept server-advertised promisor remotes when\n> +explicitly configured to do so via the `promisor.acceptFromServer` or\n> +`promisor.acceptFromServerUrl` options (see linkgit:git-config[1]),\n> +which prevents arbitrary injection of untrusted remotes by servers.\n>  After trying the accepted remotes, Git then tries the other configured\n>  promisor remotes as described below.\n\nSpecifically, the commit message states: \"The implementation uses a\ntwo-pass approach ... Document this behavior to make the technical\ndesign notes complete.\"  But the patch text provides the documentation\nof the two-pass approach as context lines (without '+'), and only adds\nthe security model paragraph:\n\nWhen sending a new topic that is not anywhere in my tree, please\nmake sure it applies to either (1) the last published feature\nrelease (currently, Git 2.56.0), or (2) a recent tip of 'master'\nbranch.  The former is preferred for a topic to fix a bug in the\nreleased version, while the latter is more appropriate for a new\nfeature and behavior.  A patch that does not apply to either should\nbe accompanied by a note that explains on what tree it is designed\nto be applied (see [*] for an example of how it is communicated).\n\nThanks.\n\n\n[Reference]\n\n * In https://lore.kernel.org/git/20261023-b4-pks-odb-extension-v3-0-b1bb30a006db@pks.im/\n   the author explains the base of the topic as:\n\n      The series is built on top of c51408889c (The 6th batch, 2026-10-16)\n      with the following dependencies merged into it:\n\n      - ps/odb-files-alternates at 0ba59c8453 (odb/source: drop\n        `read_alternates` callback, 2026-10-08) merged into it.\n\n      - ps/setup-enforce-repo-passed-to-create-repository-has-no-state\n        (phew, what a mouthful) at 0ba59c8453 (odb/source: drop\n        `read_alternates` callback, 2026-10-08).\n\n * The resulting topic, applying the patches on a synthetic base the\n   above instruction describes, looks like this:\n\n   $ git log --first-parent --oneline master..901d6767e6\n   901d6767e6 builtin/submodule: propagate \"--object-storage-format=\"\n   ed8e104fe6 builtin/clone: introduce \"--object-storage-format=\"\n   3545b04fde builtin/init: introduce handling of object storage format\n   590e753455 builtin: expose the object storage format\n   074bf8b219 setup: allow overriding object storage format via environment\n   0538b7b345 setup: introduce object storage extension\n   27dfe6b692 loose: drop unused `repo_write_loose_object_map()`\n   1cdc1db14b Merge branch 'ps/setup-enforce-repo-passed-to-create-repository-has-no-state' into ps/odb-object-storage-extension\n   7464b1a063 Merge branch 'ps/odb-files-alternates' into ps/odb-object-storage-extension\n\n"}]}