{"thread":{"id":"66805","subject":"[PATCH v2] doc: describe promisor remote fetch order","startedAt":"2026-11-08T07:19:33Z","lastAt":"2026-11-10T12:58:05Z","messageCount":12,"participants":["Hussain Sitamouwala","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"557833","messageId":"20261108071933.6586-1-husainsitamuwala21@gmail.com","threadId":"66805","inReplyTo":null,"subject":"[PATCH v2] doc: describe promisor remote fetch order","fromName":"Hussain Sitamouwala","fromEmail":"husainsitamuwala21@gmail.com","sentAt":"2026-11-08T07:19:33Z","receivedAt":"2026-11-08T07:19:33Z","isPatch":true,"sender":{"key":"husainsitamuwala21@gmail.com","avatar":null},"body":"Explain that promisor remotes accepted from a server are tried\nbefore other promisor remotes, and that the remaining objects are\nrequested from the next remote when a fetch fails. The ordering\nwas introduced by 8808e61fd3 (promisor-remote: try accepted\nremotes before others in get_direct(), 2026-04-07).\n\nSigned-off-by: Hussain Sitamouwala <husainsitamuwala21@gmail.com>\n---\nChanges since v1:\n- shortened the subject and wrapped the commit message\n- clarified what \"accepted\" means and the fetch fallback wording\n- checked the wording against try_promisor_remotes()\n\n Documentation/technical/partial-clone.adoc | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/technical/partial-clone.adoc b/Documentation/technical/partial-clone.adoc\nindex 18718a3840..efe9acac65 100644\n--- a/Documentation/technical/partial-clone.adoc\n+++ b/Documentation/technical/partial-clone.adoc\n@@ -195,7 +195,10 @@ cache servers for fetching missing blobs while continuing to do\n 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+until all the objects have been fetched. Promisor remotes that the\n+client accepted from a server's advertisement are tried before the\n+other promisor remotes. If a fetch from a remote fails, the objects\n+that are still missing are requested from the next remote.\n \n Remotes that are considered \"promisor\" remotes are those specified by\n the following configuration variables:\n-- \n2.53.0\n\n\n"},{"id":"557850","messageId":"xmqqy0b32mcl.fsf@gitster.g","threadId":"66805","inReplyTo":"20261108071933.6586-1-husainsitamuwala21@gmail.com","subject":"Re: [PATCH v2] doc: describe promisor remote fetch order","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-08T18:45:46Z","receivedAt":"2026-11-08T18:45:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Hussain Sitamouwala <husainsitamuwala21@gmail.com> writes:\n\n> Explain that promisor remotes accepted from a server are tried\n> before other promisor remotes, and that the remaining objects are\n> requested from the next remote when a fetch fails. The ordering\n> was introduced by 8808e61fd3 (promisor-remote: try accepted\n> remotes before others in get_direct(), 2026-04-07).\n>\n> Signed-off-by: Hussain Sitamouwala <husainsitamuwala21@gmail.com>\n> ---\n> Changes since v1:\n> - shortened the subject and wrapped the commit message\n> - clarified what \"accepted\" means and the fetch fallback wording\n> - checked the wording against try_promisor_remotes()\n\nPlease thread your patches correctly.\n\nThis message, which sends the v2 iteration of the patch, should be a\nreply to your v1.  However, there is no In-Reply-To (or References)\nheader linking this message to the message that contained the v1\niteration.  This hurts automation.\n\nAlso, it is not considered good manners to send a new iteration\nbefore first finishing the discussion on the reviews you received on\nyour previous iteration.  You respond to reviews, saying \"I will fix\nthis point\", \"I think this one is fine as-is because...\", and so\nforth, wait for responses to your response, and eventually come to\nan agreement with those in the discussion.  Only after finishing all\nof that do you prepare and send a new iteration.\n\nThanks.\n\n>  Documentation/technical/partial-clone.adoc | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n>\n> diff --git a/Documentation/technical/partial-clone.adoc b/Documentation/technical/partial-clone.adoc\n> index 18718a3840..efe9acac65 100644\n> --- a/Documentation/technical/partial-clone.adoc\n> +++ b/Documentation/technical/partial-clone.adoc\n> @@ -195,7 +195,10 @@ cache servers for fetching missing blobs while continuing to do\n>  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> +until all the objects have been fetched. Promisor remotes that the\n> +client accepted from a server's advertisement are tried before the\n> +other promisor remotes. If a fetch from a remote fails, the objects\n> +that are still missing are requested from the next remote.\n>  \n>  Remotes that are considered \"promisor\" remotes are those specified by\n>  the following configuration variables:\n\n"},{"id":"557851","messageId":"xmqqse1b2ljp.fsf@gitster.g","threadId":"66805","inReplyTo":"20261108071933.6586-1-husainsitamuwala21@gmail.com","subject":"Re: [PATCH v2] doc: describe promisor remote fetch order","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-08T19:03:06Z","receivedAt":"2026-11-08T19:03:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Hussain Sitamouwala <husainsitamuwala21@gmail.com> writes:\n\n> Explain that promisor remotes accepted from a server are tried\n> before other promisor remotes, and that the remaining objects are\n> requested from the next remote when a fetch fails. The ordering\n> was introduced by 8808e61fd3 (promisor-remote: try accepted\n> remotes before others in get_direct(), 2026-04-07).\n\nWell written.  \"next\" sounded a bit strange thing to say in the\ncontext, but it was understandable.\n\nAssuming that I understood what the author wanted to say correctly,\nthat is ;-), so let's double-check.  Would it mean the same thing if\nwe replace \"next remote\" with \"other promisor remotes\"?\n\n>  Documentation/technical/partial-clone.adoc | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n>\n> diff --git a/Documentation/technical/partial-clone.adoc b/Documentation/technical/partial-clone.adoc\n> index 18718a3840..efe9acac65 100644\n> --- a/Documentation/technical/partial-clone.adoc\n> +++ b/Documentation/technical/partial-clone.adoc\n> @@ -195,7 +195,10 @@ cache servers for fetching missing blobs while continuing to do\n>  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> +until all the objects have been fetched. Promisor remotes that the\n> +client accepted from a server's advertisement are tried before the\n> +other promisor remotes. If a fetch from a remote fails, the objects\n> +that are still missing are requested from the next remote.\n\nThe same comment on \"next\" here.\n\n"},{"id":"557852","messageId":"20261108190743.508-1-husainsitamuwala21@gmail.com","threadId":"66805","inReplyTo":"xmqqy0b32mcl.fsf@gitster.g","subject":"Re: [PATCH v2] doc: describe promisor remote fetch order","fromName":"Hussain Sitamouwala","fromEmail":"husainsitamuwala21@gmail.com","sentAt":"2026-11-08T19:07:43Z","receivedAt":"2026-11-08T19:07:43Z","isPatch":true,"sender":{"key":"husainsitamuwala21@gmail.com","avatar":null},"body":"Hi Junio,\n\nThanks for the review.\n\n> Please thread your patches correctly.\n\nSorry about that. I will send later iterations as replies to the\nprevious one using --in-reply-to.\n\n> it is not considered good manners to send a new iteration before\n> first finishing the discussion on the reviews you received on your\n> previous iteration.\n\nUnderstood, and sorry for sending v2 early. I will reply to the\nremaining review comments on v1 first, and only send a new version\nonce we have agreed on the changes.\n\nThanks,\nHussain\n\n"},{"id":"557854","messageId":"20261108191212.594-1-husainsitamuwala21@gmail.com","threadId":"66805","inReplyTo":"xmqqse1b2ljp.fsf@gitster.g","subject":"Re: [PATCH v2] doc: describe promisor remote fetch order","fromName":"Hussain Sitamouwala","fromEmail":"husainsitamuwala21@gmail.com","sentAt":"2026-11-08T19:12:12Z","receivedAt":"2026-11-08T19:12:12Z","isPatch":true,"sender":{"key":"husainsitamuwala21@gmail.com","avatar":null},"body":"Hi Junio,\n\nThanks for the review.\n\n> Would it mean the same thing if we replace \"next remote\" with\n> \"other promisor remotes\"?\n\nYes, that is what I meant. When a fetch from one promisor remote\nfails, the objects that are still missing are requested from the\nother promisor remotes, in turn. \"Other promisor remotes\" is\nclearer, and it matches the previous sentence, so I will change\nboth places in the next version.\n\nThanks,\nHussain\n\n"},{"id":"557858","messageId":"xmqqo6bz2kxd.fsf@gitster.g","threadId":"66805","inReplyTo":"xmqqse1b2ljp.fsf@gitster.g","subject":"Re: [PATCH v2] doc: describe promisor remote fetch order","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-08T19:16:30Z","receivedAt":"2026-11-08T19:16:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Hussain Sitamouwala <husainsitamuwala21@gmail.com> writes:\n>\n>> Explain that promisor remotes accepted from a server are tried\n>> before other promisor remotes, and that the remaining objects are\n>> requested from the next remote when a fetch fails. The ordering\n>\n> Well written.  \"next\" sounded a bit strange thing to say in the\n> context, but it was understandable.\n>\n> Assuming that I understood what the author wanted to say correctly,\n> that is ;-), so let's double-check.  Would it mean the same thing if\n> we replace \"next remote\" with \"other promisor remotes\"?\n\nAfter thinking about this a bit more, I know why I thought this was\nstrange.\n\n>>  When fetching objects, promisor remotes are tried one after the other\n>> +client accepted from a server's advertisement are tried before the\n>> +other promisor remotes. If a fetch from a remote fails, the objects\n>> +that are still missing are requested from the next remote.\n\nI think the entire sentence after \"If a fetch from a remote fails\"\nshould be removed.  You already established that while fetching,\nremotes are tried one after the other.  What does it mean?  We try\npromisor A, and if the fetch from it fails to obtain certain\nobjects, we try promisor B, and then C, and so on.  We already said\nthat and you clarified in which order these promisors A and B and C \nare consulted.\n\nSo, there is absolutely nothing left to be said.  The last sentence,\nwhile it may not say anything wrong, is simply redundant without\nadding any new information.\n\n\n"},{"id":"557859","messageId":"20261108192232.681-1-husainsitamuwala21@gmail.com","threadId":"66805","inReplyTo":"xmqqo6bz2kxd.fsf@gitster.g","subject":"Re: [PATCH v2] doc: describe promisor remote fetch order","fromName":"Hussain Sitamouwala","fromEmail":"husainsitamuwala21@gmail.com","sentAt":"2026-11-08T19:22:32Z","receivedAt":"2026-11-08T19:22:32Z","isPatch":true,"sender":{"key":"husainsitamuwala21@gmail.com","avatar":null},"body":"Hi Junio,\n\nThanks for the review.\n\n> I think the entire sentence after \"If a fetch from a remote fails\"\n> should be removed.\n\nYou are right. The fallback is already implied by \"tried one after\nthe other\", so the sentence adds nothing. I will remove it from the\ndocumentation and also drop the matching clause from the commit\nmessage.\n\nThanks,\nHussain\n\n"},{"id":"557860","messageId":"20261108195518.943-1-husainsitamuwala21@gmail.com","threadId":"66805","inReplyTo":"20261108071933.6586-1-husainsitamuwala21@gmail.com","subject":"[PATCH v3] doc: describe promisor remote fetch order","fromName":"Hussain Sitamouwala","fromEmail":"husainsitamuwala21@gmail.com","sentAt":"2026-11-08T19:55:18Z","receivedAt":"2026-11-08T19:55:18Z","isPatch":true,"sender":{"key":"husainsitamuwala21@gmail.com","avatar":null},"body":"Explain that promisor remotes accepted from a server are tried\nbefore other promisor remotes. The ordering was introduced by\n8808e61fd3 (promisor-remote: try accepted remotes before others in\nget_direct(), 2026-04-07).\n\nSigned-off-by: Hussain Sitamouwala <husainsitamuwala21@gmail.com>\n---\nChanges since v2:\n- removed the redundant fetch-fallback sentence, as suggested by Junio\n- dropped the matching clause from the commit message\n Documentation/technical/partial-clone.adoc | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/technical/partial-clone.adoc b/Documentation/technical/partial-clone.adoc\nindex 18718a3840..52fce44384 100644\n--- a/Documentation/technical/partial-clone.adoc\n+++ b/Documentation/technical/partial-clone.adoc\n@@ -195,7 +195,9 @@ cache servers for fetching missing blobs while continuing to do\n 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+until all the objects have been fetched. Promisor remotes that the\n+client accepted from a server's advertisement are tried before the\n+other promisor remotes.\n \n Remotes that are considered \"promisor\" remotes are those specified by\n the following configuration variables:\n-- \n2.53.0\n\n\n"},{"id":"557861","messageId":"20261108213814.151202-1-husainsitamuwala21@gmail.com","threadId":"66805","inReplyTo":"xmqqo6bz2kxd.fsf@gitster.g","subject":"[PATCH] environment: move assume_unchanged into repo_config_values","fromName":"Hussain Sitamouwala","fromEmail":"husainsitamuwala21@gmail.com","sentAt":"2026-11-08T21:38:14Z","receivedAt":"2026-11-08T21:38:14Z","isPatch":true,"sender":{"key":"husainsitamuwala21@gmail.com","avatar":null},"body":"Move assume_unchanged from global state into repository-specific\nconfiguration to avoid sharing the setting across repositories.\n\nAdd a repository getter and update the callers to retrieve the\nvalue using the appropriate repository instance.\n\nSigned-off-by: Hussain Sitamouwala <husainsitamuwala21@gmail.com>\n---\n builtin/update-index.c |  2 +-\n environment.c          | 11 +++++++++--\n environment.h          |  3 ++-\n read-cache.c           |  6 +++---\n 4 files changed, 15 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex 018b78d6bb..65e9858457 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -431,7 +431,7 @@ static int add_cacheinfo(unsigned int mode, const struct object_id *oid,\n \tce->ce_flags = create_ce_flags(stage);\n \tce->ce_namelen = len;\n \tce->ce_mode = create_ce_mode(mode);\n-\tif (assume_unchanged)\n+\tif (repo_assume_unchanged(the_repository))\n \t\tce->ce_flags |= CE_VALID;\n \toption = allow_add ? ADD_CACHE_OK_TO_ADD : 0;\n \toption |= allow_replace ? ADD_CACHE_OK_TO_REPLACE : 0;\ndiff --git a/environment.c b/environment.c\nindex c83cf44839..17398c36d0 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -42,7 +42,6 @@ static int pack_compression_seen;\n static int zlib_compression_seen;\n \n int minimum_abbrev = 4, default_abbrev = -1;\n-int assume_unchanged;\n char *git_commit_encoding;\n char *git_log_output_encoding;\n int fsync_object_files = -1;\n@@ -152,6 +151,13 @@ int repo_has_symlinks(struct repository *repo)\n \t\t: platform_has_symlinks();\n }\n \n+int repo_assume_unchanged(struct repository *repo)\n+{\n+\treturn repo->initialized\n+\t\t? repo_config_values(repo)->assume_unchanged\n+\t\t: 0;\n+}\n+\n const char *repo_excludes_file(struct repository *repo)\n {\n \tstruct repo_config_values *cfg = repo_config_values(repo);\n@@ -371,7 +377,7 @@ int git_default_core_config(const char *var, const char *value,\n \t}\n \n \tif (!strcmp(var, \"core.ignorestat\")) {\n-\t\tassume_unchanged = git_config_bool(var, value);\n+\t\tcfg->assume_unchanged = git_config_bool(var, value);\n \t\treturn 0;\n \t}\n \n@@ -775,6 +781,7 @@ void repo_config_values_init(struct repo_config_values *cfg)\n \tcfg->protect_ntfs = PROTECT_NTFS_DEFAULT;\n \tcfg->ignore_case = 0;\n \tcfg->trust_executable_bit = 1;\n+\tcfg->assume_unchanged = 0;\n \tcfg->has_symlinks = platform_has_symlinks();\n \tcfg->use_nanosec = 0;\n \ndiff --git a/environment.h b/environment.h\nindex 49c86e8879..bff7a7f911 100644\n--- a/environment.h\n+++ b/environment.h\n@@ -147,6 +147,7 @@ struct repo_config_values {\n \tint protect_ntfs;\n \tint ignore_case;\n \tint trust_executable_bit;\n+\tint assume_unchanged;\n \tint has_symlinks;\n \tint use_nanosec;\n \n@@ -200,6 +201,7 @@ int repo_protect_ntfs(struct repository *repo);\n int repo_ignore_case(struct repository *repo);\n \n int repo_trust_executable_bit(struct repository *repo);\n+int repo_assume_unchanged(struct repository *repo);\n \n int repo_has_symlinks(struct repository *repo);\n \n@@ -242,7 +244,6 @@ int have_git_dir(void);\n \n /* Environment bits from configuration mechanism */\n extern int minimum_abbrev, default_abbrev;\n-extern int assume_unchanged;\n extern unsigned long pack_size_limit_cfg;\n \n extern int grafts_keep_true_parents;\ndiff --git a/read-cache.c b/read-cache.c\nindex 1d2b97c429..990bcc32c4 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -194,7 +194,7 @@ void fill_stat_cache_info(struct index_state *istate, struct cache_entry *ce, st\n {\n \tfill_stat_data(&ce->ce_stat_data, st);\n \n-\tif (assume_unchanged)\n+\tif (repo_assume_unchanged(istate->repo))\n \t\tce->ce_flags |= CE_VALID;\n \n \tif (S_ISREG(st->st_mode)) {\n@@ -1415,7 +1415,7 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,\n \t\t * is not marked VALID, this is the place to mark it\n \t\t * valid again, under \"assume unchanged\" mode.\n \t\t */\n-\t\tif (ignore_valid && assume_unchanged &&\n+\t\tif (ignore_valid && repo_assume_unchanged(istate->repo) &&\n \t\t    !(ce->ce_flags & CE_VALID))\n \t\t\t; /* mark this one VALID again */\n \t\telse {\n@@ -1450,7 +1450,7 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,\n \t * (i.e. things to be edited) will reacquire CE_VALID bit\n \t * automatically, which is not really what we want.\n \t */\n-\tif (!ignore_valid && assume_unchanged &&\n+\tif (!ignore_valid && repo_assume_unchanged(istate->repo) &&\n \t    !(ce->ce_flags & CE_VALID))\n \t\tupdated->ce_flags &= ~CE_VALID;\n \n-- \n2.53.0\n\n\n"},{"id":"557871","messageId":"xmqqse1a1th8.fsf@gitster.g","threadId":"66805","inReplyTo":"20261108195518.943-1-husainsitamuwala21@gmail.com","subject":"Re: [PATCH v3] doc: describe promisor remote fetch order","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-09T05:09:23Z","receivedAt":"2026-11-09T05:09:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Hussain Sitamouwala <husainsitamuwala21@gmail.com> writes:\n\n> Explain that promisor remotes accepted from a server are tried\n> before other promisor remotes. The ordering was introduced by\n> 8808e61fd3 (promisor-remote: try accepted remotes before others in\n> get_direct(), 2026-04-07).\n\nThis iteration looks good.  Will queue.\n\n> -until all the objects have been fetched.\n> +until all the objects have been fetched. Promisor remotes that the\n> +client accepted from a server's advertisement are tried before the\n> +other promisor remotes.\n\nChristian, perhaps time for an Ack?\n\nThanks.\n\n"},{"id":"557959","messageId":"xmqqcxse101u.fsf@gitster.g","threadId":"66805","inReplyTo":"20261108192232.681-1-husainsitamuwala21@gmail.com","subject":"Re: [PATCH v2] doc: describe promisor remote fetch order","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-09T15:45:01Z","receivedAt":"2026-11-09T15:45:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Hussain Sitamouwala <husainsitamuwala21@gmail.com> writes:\n\n> Hi Junio,\n>\n> Thanks for the review.\n>\n>> I think the entire sentence after \"If a fetch from a remote fails\"\n>> should be removed.\n>\n> You are right. The fallback is already implied by \"tried one after\n> the other\", so the sentence adds nothing. I will remove it from the\n> documentation and also drop the matching clause from the commit\n> message.\n\nWas that extra \"not wrong per-se but totally unnecessary without\nadding any new information\" sentence added by LLM by any chance?\nJust being curious.\n\nThanks.\n\n"},{"id":"558075","messageId":"CANRKfoDaaF+Dp8b_7GvXsH9mGWqHSxDWK9HbxCcc_j=gz+V=Tg@mail.gmail.com","threadId":"66805","inReplyTo":"xmqqcxse101u.fsf@gitster.g","subject":"Re: [PATCH v2] doc: describe promisor remote fetch order","fromName":"Hussain Sitamouwala","fromEmail":"husainsitamuwala21@gmail.com","sentAt":"2026-11-10T12:58:05Z","receivedAt":"2026-11-10T12:58:05Z","isPatch":true,"sender":{"key":"husainsitamuwala21@gmail.com","avatar":null},"body":"On Mon, Nov 9, 2026 at 9:15 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Was that extra \"not wrong per-se but totally unnecessary without\n> adding any new information\" sentence added by LLM by any chance?\n> Just being curious.\n\nNo, I wrote that sentence myself. I was trying to spell out the\nfallback behavior explicitly, but you are right that \"tried one\nafter the other\" already covers it.\n\nI do use an AI tool to clear up doubts while I am learning the\ncodebase, but I did not use it to generate the patch text.\n\nThanks for queueing v3.\n\nThanks,\nHussain\n\n"}]}