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

[PATCH 2/2] rev-list: disable object/refname ambiguity check with --stdin

From
Jeff King <peff@peff.net>
Date
Mar 12, 2014, 20:06 UTC
Message-ID
<20140312200617.GB3506@sigill.intra.peff.net>
In-Reply-To
<20140312200348.GB1816@sigill.intra.peff.net>

This is the "rev-list" analogue to 25fba78 (cat-file: disable object/refname ambiguity check for batch mode, 2013-07-12). Like cat-file, "rev-list --stdin" may read a large number of sha1 object names, and the warning check introduces a significant slow-down.

Signed-off-by: Jeff King <peff@peff.net>
---
 revision.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/revision.c b/revision.c
index bd027bc..68d1b76 100644
--- a/revision.c
+++ b/revision.c
@@ -1575,6 +1575,10 @@ static void read_revisions_from_stdin(struct rev_info *revs,
 {
 	struct strbuf sb;
 	int seen_dashdash = 0;
+	int save_warning;
+
+	save_warning = warn_on_object_refname_ambiguity;
+	warn_on_object_refname_ambiguity = 0;
 
 	strbuf_init(&sb, 1000);
 	while (strbuf_getwholeline(&sb, stdin, '\n') != EOF) {
@@ -1596,7 +1600,9 @@ static void read_revisions_from_stdin(struct rev_info *revs,
 	}
 	if (seen_dashdash)
 		read_pathspec_from_stdin(revs, &sb, prune);
+
 	strbuf_release(&sb);
+	warn_on_object_refname_ambiguity = save_warning;
 }
 
 static void add_grep(struct rev_info *revs, const char *ptn, enum grep_pat_token what)
-- 
1.9.0.403.g7a2f4b0
Previous: Jeff King
Message 8 of 8 in “What's cooking in git.git (Mar 2014, #02; Tue, 11)”
  1. Junio C HamanoMar 11, 2014
  2. Duy NguyenMar 11, 2014
  3. Junio C HamanoMar 12, 2014
  4. Jeff KingMar 12, 2014
  5. Junio C HamanoMar 12, 2014
  6. Jeff KingMar 12, 2014
  7. 1/2 cat-file: restore warn_on_object_refname_ambiguity flagJeff King, Mar 12, 2014
  8. 2/2 rev-list: disable object/refname ambiguity check with --stdinJeff King, Mar 12, 2014

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.