Re: [Outreachy][PATCH] promisor-remote: honor promisor.fetchOrder when trying remotes
- From
- Tanga Joris <tangajoris@gmail.com>
- Date
- Nov 5, 2026, 14:30 UTC
- Message-ID
- <CAKrRMNpAW+f2XXMFqpB8ffZsTdyPsaFtHe8dku=JVXACp1M3Hw@mail.gmail.com>
- In-Reply-To
- <20261104172434.691381-1-yopatatchou@gmail.com>
Hello Nelly,
Thanks for working on this, being able to choose the order of promisor remotes sounds useful.
I tried your patch on top of master (0ffa3e35c7) in a partial clone, and I think there is a problem when the new variable is set:
$ git config promisor.fetchOrder origin $ git show HEAD:f BUG: string-list.c:340: string_list_split_in_place() called with strdup_strings
On Wed, 4 Nov 2026 at 20:48, Yopa Nelly <yopatatchou@gmail.com> wrote:
Show 6 quoted lines
> + char *value_copy; > + > + if (!value) > + return config_error_nonbool(var); > + value_copy = xstrdup(value); > + string_list_split_in_place_f(&fetch_order, value_copy, ",", -1,
Without the variable it works fine. I think this is because fetch_order is created with STRING_LIST_INIT_DUP, but string_list_split_in_place_f() is used on it. Maybe string_list_split_f() would work here instead?
Also, each time the variable is seen the names are added to the same list. The list is never cleared, so values from several config files pile up.
It also looks like the list is file-static, so every repository in the process (for example submodules) shares it, while the rest of the promisor config lives in each repository's struct promisor_remote_config.
> No test, and I want to be upfront about why. The t5710 fixture
Thank you for being upfront about this. I noticed that t0410-partial-clone.sh already has a test with two promisor remotes ("fetching from another promisor remote"), so maybe a test for the order could go there. It would also catch the crash above.
I also could not find the new variable in Documentation/config/promisor.adoc. I suggest adding it there too.
> + if (!strcmp(var, "promisor.fetchorder")) {One small thing: this line is indented with spaces instead of a tab.
Best, Tanga