Re: [BUG] git grep broken on master - won't work when merging

Subsystems: the rest

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [BUG] git grep broken on master - won't work when merging

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:47

"Martin Langhoff" [off-list ref] writes:
Strange behaviour of git grep on one of the projects I hack on...

  $ git --version
  git version 1.5.3.5.561.g140d

  $ git grep LOB lib
  fatal: insanely many options to grep

After a bit of head-scratching I realised I was in the middle of a
merge, with some unresolved paths in the lib directory. A bit of
testing shows that the unresolved index is probably the problem:

  $ git grep LOB lib
  fatal: insanely many options to grep

  # an unresolved file
  $ git grep  LOB lib/accesslib.php
  fatal: insanely many options to grep
I think 36f2587ffb6802cb38071510810f48cddfc4f34a (grep: do not
skip unmerged entries when grepping in the working tree.) is the
dud one.  Would this help?
diff --git a/builtin-grep.c b/builtin-grep.c
index c7b45c4..185876b 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -343,7 +343,7 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
 			memcpy(name + 2, ce->name, len + 1);
 		}
 		argv[argc++] = name;
-		if (argc < MAXARGS && !ce_stage(ce))
+		if (argc < MAXARGS)
 			continue;
 		status = flush_grep(opt, argc, nr, argv, &kept);
 		if (0 < status)

Re: [BUG] git grep broken on master - won't work when merging

From: Martin Langhoff <hidden>
Date: 2016-06-15 22:43:47

On 11/6/07, Junio C Hamano [off-list ref] wrote:
I think 36f2587ffb6802cb38071510810f48cddfc4f34a (grep: do not
skip unmerged entries when grepping in the working tree.) is the
dud one.  Would this help?
Works great here! Thanks!

cheers,


martin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help