From: Kaartic Sivaraam Date: Thu, 05 Nov 2026 16:31:22 GMT Subject: Re: [Outreachy][PATCH] promisor-remote: honor promisor.fetchOrder when trying remotes Message-ID: <894327d9-57b5-4adc-b300-25d946211606@gmail.com> In-Reply-To: <20261104172434.691381-1-yopatatchou@gmail.com> 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