Christian Couder
8808e61fd3
promisor-remote: try accepted remotes before others in get_direct()
...
When a server advertises promisor remotes and the client accepts some
of them, those remotes carry the server's intent: 'fetch missing
objects preferably from here', and the client agrees with that for the
remotes it accepts.
However promisor_remote_get_direct() actually iterates over all
promisor remotes in list order, which is the order they appear in the
config files (except perhaps for the one appearing in the
`extensions.partialClone` config variable which is tried last).
This means an existing, but not accepted, promisor remote, could be
tried before the accepted ones, which does not reflect the intent of
the agreement between client and server.
If the client doesn't care about what the server suggests, it should
accept nothing and rely on its remotes as they are already configured.
To better reflect the agreement between client and server, let's make
promisor_remote_get_direct() try the accepted promisor remotes before
the non-accepted ones.
Concretely, let's extract a try_promisor_remotes() helper and call it
twice from promisor_remote_get_direct():
- first with an `accepted_only=true` argument to try only the accepted
remotes,
- then with `accepted_only=false` to fall back to any remaining remote.
Ensuring that accepted remotes are preferred will be even more
important if in the future a mechanism is developed to allow the
client to auto-configure remotes that the server advertises. This will
in particular avoid fetching from the server (which is already
configured as a promisor remote) before trying the auto-configured
remotes, as these new remotes would likely appear at the end of the
config file, and as the server might not appear in the
`extensions.partialClone` config variable.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org >
Signed-off-by: Junio C Hamano <gitster@pobox.com >
2026-04-07 08:45:43 -07:00
..
2026-03-12 14:09:06 -07:00
2025-11-06 09:58:56 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:03 -07:00
2026-03-23 09:20:31 -07:00
2025-12-05 14:49:56 +09:00
2025-01-21 12:56:10 -08:00
2026-02-05 21:14:05 -08:00
2025-07-07 13:45:00 -07:00
2026-01-09 06:15:31 -08:00
2025-10-15 09:11:08 -07:00
2025-03-01 10:26:15 -08:00
2025-04-16 07:30:30 -07:00
2026-03-04 10:53:01 -08:00
2025-10-15 10:29:34 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-11-17 09:31:59 -08:00
2025-07-29 08:52:45 -07:00
2025-08-11 14:16:03 -07:00
2025-06-18 13:53:34 -07:00
2026-03-02 08:53:28 -08:00
2023-05-05 14:28:03 -07:00
2024-07-23 11:02:52 -07:00
2025-01-21 12:56:06 -08:00
2026-02-27 15:11:54 -08:00
2025-04-16 07:30:29 -07:00
2026-02-05 21:14:05 -08:00
2026-02-12 14:37:56 -08:00
2026-02-12 14:37:56 -08:00
2026-01-12 06:55:41 -08:00
2024-12-07 07:52:13 +09:00
2026-02-06 09:43:26 -08:00
2026-03-02 17:06:52 -08:00
2025-01-21 12:56:06 -08:00
2025-07-07 06:41:11 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-10-28 15:41:42 -07:00
2026-01-09 06:15:53 -08:00
2025-05-05 10:48:07 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-08-11 14:16:04 -07:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-12-20 14:55:43 +09:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-02-25 11:54:17 -08:00
2025-06-01 17:20:16 -07:00
2025-10-22 10:40:11 -07:00
2025-01-21 12:56:06 -08:00
2025-11-14 08:56:35 -08:00
2026-02-23 13:23:40 -08:00
2025-10-14 13:40:54 -07:00
2025-01-21 12:56:06 -08:00
2025-02-14 17:53:47 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-03-10 09:58:06 -07:00
2025-05-12 09:25:26 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-03-03 08:17:47 -08:00
2025-01-21 12:56:06 -08:00
2025-05-22 14:20:11 -07:00
2025-08-11 14:16:04 -07:00
2025-07-09 16:08:29 -07:00
2025-11-26 08:43:44 -08:00
2025-01-21 12:56:06 -08:00
2025-11-19 15:00:37 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-08-25 14:22:02 -07:00
2025-01-21 12:56:06 -08:00
2026-02-27 15:11:54 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-02-17 08:37:51 -08:00
2026-02-19 13:24:57 -08:00
2025-02-14 17:53:49 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-07-22 08:49:15 -07:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-09-10 13:34:58 -07:00
2025-01-21 12:56:06 -08:00
2025-08-22 11:12:27 -07:00
2026-01-20 14:13:04 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-11-10 09:28:48 -08:00
2025-01-21 12:56:06 -08:00
2026-02-07 17:04:26 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-10-10 12:51:46 -07:00
2025-07-14 11:19:28 -07:00
2025-01-21 12:56:06 -08:00
2025-05-27 07:51:01 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-10-15 10:29:33 -07:00
2025-04-14 14:43:52 -07:00
2025-01-21 12:56:06 -08:00
2025-05-27 15:31:08 -07:00
2025-08-11 14:16:03 -07:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-09-19 10:02:56 -07:00
2026-02-17 10:49:51 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-12-14 17:04:37 +09:00
2025-11-19 15:00:45 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-08-11 14:16:04 -07:00
2026-03-06 13:02:20 -08:00
2025-05-20 11:43:36 -07:00
2025-08-06 07:36:30 -07:00
2025-10-02 12:26:12 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-12-21 11:33:10 +09:00
2025-12-20 14:55:43 +09:00
2025-01-21 12:56:06 -08:00
2026-02-09 12:09:09 -08:00
2026-03-16 10:48:14 -07:00
2025-01-21 12:56:06 -08:00
2026-02-09 11:58:53 -08:00
2026-01-06 08:10:14 +09:00
2025-08-04 08:10:33 -07:00
2025-01-21 12:56:06 -08:00
2025-10-22 11:38:58 -07:00
2025-01-21 12:56:06 -08:00
2025-04-14 14:43:52 -07:00
2026-03-12 10:56:05 -07:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-02-11 12:29:07 -08:00
2025-01-21 12:56:06 -08:00
2025-02-14 17:53:47 -08:00
2025-01-21 12:56:06 -08:00
2026-02-05 21:14:05 -08:00
2025-10-28 10:29:09 -07:00
2025-12-21 11:33:10 +09:00
2025-10-05 16:09:03 -07:00
2025-12-21 11:33:10 +09:00
2025-05-27 15:31:05 -07:00
2026-02-05 21:14:05 -08:00
2025-08-11 14:16:03 -07:00
2025-07-28 14:24:03 -07:00
2025-01-21 12:56:06 -08:00
2025-10-28 10:29:09 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2026-01-23 13:34:35 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-05-12 09:25:27 -07:00
2025-05-12 09:25:27 -07:00
2025-05-12 09:25:27 -07:00
2025-05-12 09:25:27 -07:00
2025-04-07 14:39:27 -07:00
2025-01-21 12:56:06 -08:00
2025-09-17 13:47:24 -07:00
2026-02-09 12:09:10 -08:00
2025-05-12 09:25:26 -07:00
2026-03-16 10:48:14 -07:00
2025-03-10 09:58:06 -07:00
2025-11-04 09:25:51 -08:00
2025-01-21 12:56:06 -08:00
2025-10-15 10:29:35 -07:00
2025-01-21 12:56:06 -08:00
2025-12-03 00:17:07 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-01-16 12:40:27 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-02-07 17:41:03 -08:00
2025-10-09 17:46:14 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-12-08 22:20:14 +09:00
2025-10-29 09:17:21 -07:00
2025-10-14 13:40:53 -07:00
2025-01-21 12:56:06 -08:00
2026-02-06 09:43:26 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-03-10 09:58:06 -07:00
2025-11-06 09:45:38 -08:00
2026-03-02 21:35:05 -08:00
2026-04-07 08:45:43 -07:00
2025-07-14 11:19:22 -07:00
2025-03-05 07:25:11 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:03 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-03-10 09:58:06 -07:00
2025-08-11 14:16:03 -07:00
2025-01-21 12:56:06 -08:00
2025-11-12 12:21:15 -08:00
2025-02-14 17:53:47 -08:00
2025-01-21 12:56:06 -08:00
2025-07-07 13:45:00 -07:00
2025-07-07 13:45:00 -07:00
2025-08-11 14:16:03 -07:00
2025-08-11 14:16:04 -07:00
2022-10-25 15:44:19 -07:00
2026-01-21 08:26:00 -08:00
2022-08-04 14:12:23 -07:00
2025-01-21 12:56:06 -08:00
2025-12-05 14:49:56 +09:00
2023-05-10 10:23:29 -07:00
2025-11-19 15:00:42 -08:00
2025-05-27 07:51:00 -07:00
2026-03-02 17:06:52 -08:00
2026-02-13 13:39:26 -08:00
2025-06-25 14:07:35 -07:00
2025-01-21 12:56:06 -08:00
2025-09-19 10:02:56 -07:00
2026-02-05 21:14:05 -08:00
2025-10-05 16:10:53 -07:00
2025-11-24 10:55:48 -08:00
2025-01-21 12:56:06 -08:00
2026-02-05 21:14:05 -08:00
2026-02-10 12:27:07 -08:00
2025-07-07 13:45:00 -07:00
2026-02-25 11:54:17 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-12-16 09:42:44 +09:00
2025-01-21 12:56:06 -08:00
2025-12-19 21:51:01 +09:00
2026-03-19 09:54:56 -07:00
2025-03-10 09:58:06 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-11-19 15:00:42 -08:00
2025-01-21 12:56:06 -08:00
2025-07-23 08:15:18 -07:00