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

[PATCH 1/1] send-pack: set core.warnAmbiguousRefs=false

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 6, 2018, 19:13 UTC
Message-ID
<1ef2c51550c57bddc64426081eac2dde3349fb05.1541531625.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.68.git.gitgitgadget@gmail.com>
From: Derrick Stolee <dstolee@microsoft.com>

During a 'git push' command, we run 'git send-pack' inside of our transport helper. This creates a 'git pack-objects' process and passes a list of object ids. If this list is large, then the pack-objects process can spend a lot of time checking the possible refs these strings could represent.

Remove this extra check by setting core.warnAmbiguousRefs to false as we call 'git pack-objects'.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 send-pack.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/send-pack.c b/send-pack.c
index e920ca57df..5055150fe1 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -64,6 +64,8 @@ static int pack_objects(int fd, struct ref *refs, struct oid_array *extra, struc
 	int i;
 	int rc;
 
+	argv_array_push(&po.args, "-c");
+	argv_array_push(&po.args, "core.warnAmbiguousRefs=false");
 	argv_array_push(&po.args, "pack-objects");
 	argv_array_push(&po.args, "--all-progress-implied");
 	argv_array_push(&po.args, "--revs");
-- 
gitgitgadget
Previous: Derrick Stolee via GitGitGadgetNext: Jeff King
Message 2 of 12 in “send-pack: set core.warnAmbiguousRefs=false”
  1. 0/1 send-pack: set core.warnAmbiguousRefs=falseDerrick Stolee via GitGitGadget, Nov 6, 2018
  2. 1/1 send-pack: set core.warnAmbiguousRefs=falseDerrick Stolee via GitGitGadget, Nov 6, 2018
  3. Jeff KingNov 6, 2018
  4. Jeff KingNov 6, 2018
  5. Derrick StoleeNov 6, 2018
  6. Derrick StoleeNov 6, 2018
  7. 0/1 send-pack: set core.warnAmbiguousRefs=falseDerrick Stolee via GitGitGadget, Nov 6, 2018
  8. 1/1 pack-objects: ignore ambiguous object warningsDerrick Stolee via GitGitGadget, Nov 6, 2018
  9. Jeff KingNov 6, 2018
  10. Junio C HamanoNov 7, 2018
  11. Junio C HamanoNov 7, 2018
  12. Jeff KingNov 7, 2018

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.