From: Tatchou Yopa Nelly Date: Thu, 05 Nov 2026 22:55:42 GMT Subject: Re: [Outreachy][PATCH] promisor-remote: honor promisor.fetchOrder when trying remotes Message-ID: In-Reply-To: <894327d9-57b5-4adc-b300-25d946211606@gmail.com> Hi Tanga, Thanks for the careful review you caught real bugs. I've sent a v2 that addresses all of your points: - fetch_order is now in struct promisor_remote_config, not a file-static, so it is per-repository and gets cleared with the rest of the promisor config. - The list is now initialized with string_list_init_nodup() on first use, matching what string_list_split_in_place_f() expects, so the BUG is gone. I reproduced your exact sequence to confirm. - The docs entry is added to Documentation/config/promisor.adoc. - The whitespace is fixed. I also dropped the linked-list insertion sort. Instead, try_promisor_remotes() now walks the list twice: once in fetchOrder order for the named remotes, then in original config order for the rest. That's simpler than sorting a linked list at fetch time, and it keeps the accepted/unaccepted two-pass logic unchanged. I didn't add a test yet. You mentioned t0410-partial-clone.sh already has a test with two promisor remotes ("fetching from another promisor remote"). I'll look at whether the ordering can be verified there, either as part of a v3 or as a follow-up. Kaartic, I've also re-read SubmittingPatches#describe-changes and rewritten the commit message to describe the change rather than address the reviewers directly. On the RFC point: I treated the Phase 2 config work as the micro-patch and skipped the RFC step you pointed out. Should I step back and send the design RFC first, or keep the current patch as a prototype while we discuss the config shape on the list? Thanks, Yopa Nelly On Thu, 5 Nov 2026 at 17:31, Kaartic Sivaraam wrote: > > On 11/4/26 22:54, Yopa Nelly wrote: > > From: Nelly Yopa > > > > When a repo has multiple promisor remotes, Git just tries them in > > the order they happen to be in the config. If you want to try one > > remote before another, the only way is to move lines around in the > > config file, which is awkward, especially once you have per-worktree > > or system/global configs in play. > > > > This adds a promisor.fetchOrder config variable that takes a > > comma-separated list of remote names. Remotes listed there are tried > > first, in the order they're listed. Remotes that aren't listed are > > tried afterwards, in their original config order. The > > extensions.partialClone remote still ends up last (that's done by > > promisor_remote_move_to_tail() in promisor_remote_init()), unless > > someone names it in fetchOrder, in which case its listed position > > wins. > > > > The sort happens inside each pass in try_promisor_remotes(), so the > > existing "accepted remotes before the rest" behavior is unchanged. > > Within each pass, the order from fetchOrder wins. > > > > I put the parser in promisor_remote_config() next to the other > > promisor keys. It stores the parsed list in a file-static > > string_list. The per-remote order field is set in > > promisor_remote_apply_fetch_order(), which runs at the end of > > promisor_remote_init() after the partialClone remote has been moved > > to the tail. The actual sort is a small stable insertion sort in > > promisor_remote_sort(); order == 0 means "not listed" so unnamed > > remotes still sort after named ones without losing their relative > > order. It's called once at the start of try_promisor_remotes() and > > is effectively a no-op on the second pass if the first one already > > succeeded. > > > > I didn't validate the names in fetchOrder against the set of > > configured promisor remotes. A typo just means that remote doesn't > > appear in the list and keeps its default position. That's how other > > list-valued config variables in Git behave, and it keeps the parser > > small. > > > > No test, and I want to be upfront about why. The t5710 fixture > > always has the server satisfy a filtered clone from its own > > promisor remote, so the client never actually triggers a lazy fetch > > inside that test, which means the ordering change can't be observed > > there. I'd need a different fixture, one that gives the client two > > promisor remotes and keeps the server out of the picture. I'm happy > > to write that as a follow-up if that's the right direction. > > > > To be honest, only part of the commit describes the change. The rest of > it reads part like you're talking to the people on the lis. You might > want to give the SubmittingPatches section a read: > > https://git-scm.com/docs/SubmittingPatches#describe-changes > > Also, this patch kind of tries achieve a part of the project without > actually going through the RFC part of it. That feels a bit strange. Did > you possibly misunderstand what a microproject is supposed to be? Did > you possibly read the following guides and have some difficulties with > parts of it? If so, I'd be glad to hear more about it so that we can fix > the same. > > https://git.github.io/General-Microproject-Information/ > > https://git.github.io/General-Application-Information/ > > -- > Sivaraam >