{"thread":{"id":"66632","subject":"[Outreachy PATCH] doc: clarify promisor remote fetch ordering","startedAt":"2026-10-22T11:02:04Z","lastAt":"2026-10-26T05:18:50Z","messageCount":4,"participants":["Wasswa Edson","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"555853","messageId":"CA+ew3JtPJuVNC0PR_wY=8Wxp4-JpJ0wCPvm+a=BdJ33QaMpJMQ@mail.gmail.com","threadId":"66632","inReplyTo":null,"subject":"[Outreachy PATCH] doc: clarify promisor remote fetch ordering","fromName":"Wasswa Edson","fromEmail":"edsonwasswa54@gmail.com","sentAt":"2026-10-22T11:02:04Z","receivedAt":"2026-10-22T11:02:04Z","isPatch":true,"sender":{"key":"edsonwasswa54@gmail.com","avatar":null},"body":"From fe5f35b00eafa1eb2756178445d3e88c4e9d6787 Mon Sep 17 00:00:00 2001\nFrom: Edson <edsonwasswa54@gmail.com>\nDate: Thu, 22 Oct 2026 13:09:21 +0300\nSubject: [PATCH] doc: clarify promisor remote fetch ordering\n\nSigned-off-by: Edson <edsonwasswa54@gmail.com>\n---\n Documentation/technical/partial-clone.adoc | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/Documentation/technical/partial-clone.adoc\nb/Documentation/technical/partial-clone.adoc\nindex 18718a3840..a1104930fb 100644\n--- a/Documentation/technical/partial-clone.adoc\n+++ b/Documentation/technical/partial-clone.adoc\n@@ -196,6 +196,11 @@ filtered `git-fetch` commands from the central server.\n\n When fetching objects, promisor remotes are tried one after the other\n 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+After trying the accepted remotes, Git then tries the other configured\n+promisor remotes as described below.\n\n Remotes that are considered \"promisor\" remotes are those specified by\n the following configuration variables:\n--\n2.53.0\n\n"},{"id":"555886","messageId":"xmqq5wythc57.fsf@gitster.g","threadId":"66632","inReplyTo":"CA+ew3JtPJuVNC0PR_wY=8Wxp4-JpJ0wCPvm+a=BdJ33QaMpJMQ@mail.gmail.com","subject":"Re: [Outreachy PATCH] doc: clarify promisor remote fetch ordering","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-22T17:35:00Z","receivedAt":"2026-10-22T17:35:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Wasswa Edson <edsonwasswa54@gmail.com> writes:\n\n> From fe5f35b00eafa1eb2756178445d3e88c4e9d6787 Mon Sep 17 00:00:00 2001\n> From: Edson <edsonwasswa54@gmail.com>\n> Date: Thu, 22 Oct 2026 13:09:21 +0300\n> Subject: [PATCH] doc: clarify promisor remote fetch ordering\n\nNone of the above should be included in the e-mailed patch.  Your\nMUA would record your name in the \"From:\" header, the commit title\nin the \"Subject:\" header, and the date when the public first saw\nthis contribution from you in the \"Date:\" header, which should\nbecome the author date recorded in the project history.\n\nOn the other hand, there needs to be an explanation to convince\nthe project that it should want this change before your sign-off.\n\n> Signed-off-by: Edson <edsonwasswa54@gmail.com>\n\nSee Documentation/SubmittingPatches [[dco]] and [[real-name]].\n\n> diff --git a/Documentation/technical/partial-clone.adoc\n> b/Documentation/technical/partial-clone.adoc\n> index 18718a3840..a1104930fb 100644\n> --- a/Documentation/technical/partial-clone.adoc\n> +++ b/Documentation/technical/partial-clone.adoc\n> @@ -196,6 +196,11 @@ filtered `git-fetch` commands from the central server.\n>\n>  When fetching objects, promisor remotes are tried one after the other\n>  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> +After trying the accepted remotes, Git then tries the other configured\n> +promisor remotes as described below.\n\nJust fact checking.\n\nI thought that a remote Git server cannot arbitrarily inject,\nadvertise, or force a brand-new, untrusted promisor remote config\nonto a client during a protocol exchange (such as a standard git\nfetch or git clone) if the client doesn't already have it configured\nlocally.  But the above description makes it sound as if the server\ncan advertise a remote repository that the client does not know or\ncare about and direct the client to go there first.  Is that true\n(yes, I am wondering if there is a security implication around\nhere)?\n\nThanks.\n\n\n"},{"id":"556239","messageId":"CA+ew3Ju1N0bCFkTzrop5+ckNCrgGWRzMcrLHu7DAYufzw7Gncg@mail.gmail.com","threadId":"66632","inReplyTo":"xmqq5wythc57.fsf@gitster.g","subject":"Re: [Outreachy PATCH] doc: clarify promisor remote fetch ordering","fromName":"Wasswa Edson","fromEmail":"edsonwasswa54@gmail.com","sentAt":"2026-10-25T23:35:27Z","receivedAt":"2026-10-25T23:35:27Z","isPatch":true,"sender":{"key":"edsonwasswa54@gmail.com","avatar":null},"body":"Thanks so much about that but if i look into the codebase, Your\nconcern is valid from a security perspective, but the implementation\nalready has safeguards that prevent arbitrary injection\nThen about the Git server my say is a No, coz a server cannot\narbitrarily inject a brand-new, untrusted promisor remote onto a\nclient by default. The client must explicitly configure acceptance\npolicies before any server-advertised remote will be accepted.\nIf I am wrong let me be guided.\nI am re-doing the patch again following the doc you have provided\nThank you\n\nOn Thu, 22 Oct 2026 at 20:35, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Wasswa Edson <edsonwasswa54@gmail.com> writes:\n>\n> > From fe5f35b00eafa1eb2756178445d3e88c4e9d6787 Mon Sep 17 00:00:00 2001\n> > From: Edson <edsonwasswa54@gmail.com>\n> > Date: Thu, 22 Oct 2026 13:09:21 +0300\n> > Subject: [PATCH] doc: clarify promisor remote fetch ordering\n>\n> None of the above should be included in the e-mailed patch.  Your\n> MUA would record your name in the \"From:\" header, the commit title\n> in the \"Subject:\" header, and the date when the public first saw\n> this contribution from you in the \"Date:\" header, which should\n> become the author date recorded in the project history.\n>\n> On the other hand, there needs to be an explanation to convince\n> the project that it should want this change before your sign-off.\n>\n> > Signed-off-by: Edson <edsonwasswa54@gmail.com>\n>\n> See Documentation/SubmittingPatches [[dco]] and [[real-name]].\n>\n> > diff --git a/Documentation/technical/partial-clone.adoc\n> > b/Documentation/technical/partial-clone.adoc\n> > index 18718a3840..a1104930fb 100644\n> > --- a/Documentation/technical/partial-clone.adoc\n> > +++ b/Documentation/technical/partial-clone.adoc\n> > @@ -196,6 +196,11 @@ filtered `git-fetch` commands from the central server.\n> >\n> >  When fetching objects, promisor remotes are tried one after the other\n> >  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> > +After trying the accepted remotes, Git then tries the other configured\n> > +promisor remotes as described below.\n>\n> Just fact checking.\n>\n> I thought that a remote Git server cannot arbitrarily inject,\n> advertise, or force a brand-new, untrusted promisor remote config\n> onto a client during a protocol exchange (such as a standard git\n> fetch or git clone) if the client doesn't already have it configured\n> locally.  But the above description makes it sound as if the server\n> can advertise a remote repository that the client does not know or\n> care about and direct the client to go there first.  Is that true\n> (yes, I am wondering if there is a security implication around\n> here)?\n>\n> Thanks.\n>\n\n"},{"id":"556249","messageId":"xmqqy0blujid.fsf@gitster.g","threadId":"66632","inReplyTo":"CA+ew3Ju1N0bCFkTzrop5+ckNCrgGWRzMcrLHu7DAYufzw7Gncg@mail.gmail.com","subject":"Re: [Outreachy PATCH] doc: clarify promisor remote fetch ordering","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-26T05:18:50Z","receivedAt":"2026-10-26T05:18:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Wasswa Edson <edsonwasswa54@gmail.com> writes:\n\n> ... the implementation\n> already has safeguards that prevent arbitrary injection\n> Then about the Git server my say is a No, coz a server cannot\n> arbitrarily inject a brand-new, untrusted promisor remote onto a\n> client by default. The client must explicitly configure acceptance\n> policies before any server-advertised remote will be accepted.\n\nAn explanation like the above must be in your proposed log message\nso that the next person who looks at your patch do not have to ask\nthe same question.\n\nAlso, we frown upon top-posting on this list.\n\nThanks.\n\n"}]}