git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Outreachy][PATCH] promisor-remote: honor promisor.fetchOrder when trying remotes

From
TNTatchou Yopa Nelly <yopatatchou@gmail.com>
Date
Nov 5, 2026, 22:55 UTC
Message-ID
<CAG7jffxRscX3ntX3p8L1GwGbs7WJmj6WoKPRGUuz3wcCS0NZag@mail.gmail.com>
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 <kaartic.sivaraam@gmail.com> wrote:

Show 70 quoted lines
>
> On 11/4/26 22:54, Yopa Nelly wrote:
> > From: Nelly Yopa <yopatatchou@gmail.com>
> >
> > 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
>
Previous: Kaartic SivaraamNext: Kaartic Sivaraam
Message 4 of 11 in “promisor-remote: honor promisor.fetchOrder when trying remotes”
  1. Yopa NellyNov 4, 2026
  2. Tanga JorisNov 5, 2026
  3. Kaartic SivaraamNov 5, 2026
  4. Tatchou Yopa NellyNov 5, 2026
  5. Kaartic SivaraamNov 13, 2026
  6. Tatchou Yopa NellyNov 13, 2026
  7. [Outreachy][PATCH v2] promisor-remote: honor promisor.fetchOrder when trying remotesYopa Nelly, Nov 5, 2026
  8. Junio C HamanoNov 5, 2026
  9. Christian CouderNov 13, 2026
  10. Tatchou Yopa NellyNov 13, 2026
  11. Junio C HamanoNov 13, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.