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

[PATCH] promisor-remote: remove the promisor object check for failed fetch

From
Han Young <hanyang.tony@bytedance.com>
Date
May 28, 2025, 09:58 UTC
Message-ID
<20250528095830.30306-1-hanyang.tony@bytedance.com>

If the promisor objects fail to fetch, we check the remaining objects to see if they are indeed promisor objects. Then, we die on the first remaining promisor object. However, this promisor object check is unnecessary because callers of promisor_remote_get_direct already filter out local objects. All objects passed to promisor_remote_get_direct are promisor objects.

The is_promisor_object check essentially iterates through every object in the local packfiles and adds them to an oid set. This process is agonizingly slow for large repositories. Remove the check so that we fail immediately.

Signed-off-by: Han Young <hanyang.tony@bytedance.com>
---
 promisor-remote.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/promisor-remote.c b/promisor-remote.c
index 9d058586df..f42ea4ce78 100644
--- a/promisor-remote.c
+++ b/promisor-remote.c
@@ -275,7 +275,6 @@ void promisor_remote_get_direct(struct repository *repo,
 	struct object_id *remaining_oids = (struct object_id *)oids;
 	int remaining_nr = oid_nr;
 	int to_free = 0;
-	int i;
 
 	if (oid_nr == 0)
 		return;
@@ -296,10 +295,9 @@ void promisor_remote_get_direct(struct repository *repo,
 		goto all_fetched;
 	}
 
-	for (i = 0; i < remaining_nr; i++) {
-		if (is_promisor_object(repo, &remaining_oids[i]))
-			die(_("could not fetch %s from promisor remote"),
-			    oid_to_hex(&remaining_oids[i]));
+	if (remaining_nr) {
+		die(_("could not fetch %s from promisor remote"),
+			oid_to_hex(&remaining_oids[0]));
 	}
 
 all_fetched:
-- 
2.48.1
Next: Junio C Hamano
Message 1 of 3 in “promisor-remote: remove the promisor object check for failed fetch”
  1. promisor-remote: remove the promisor object check for failed fetchHan Young, May 28, 2025
  2. Junio C HamanoMay 29, 2025
  3. Han YoungMay 30, 2025

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.