Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] RFC Allow case insensitive search flag with git-grep for fixed-strings

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:43
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Junio C Hamano [off-list ref] writes:
We got sidetracked into a larger picture issues of how to allow platform
ports to selectively call out to external grep depending on the feature
set supported by the external grep implementations.

Later I looked at the original patch, the patch text looked fine (except
that I would have called the field "ignorecase", not "caseless"), but it
wasn't signed off and did not have usable log message.

And then I forgot ;-)

Thanks for a reminder, and thanks Jeff for a resend.
By the way, I would suggest updating the test like the attached.

By looking for rEtUrN, you will catch a bug that breaks "-i"-ness
of the grep, but your test does not catch breakages in "-F"-ness.

I am also tempted to add --no-ext-grep to this test, but that would be a
separate fix when it becomes necessary, I guess.
diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh
index 87b47dd..35a1e7a 100755
--- a/t/t7002-grep.sh
+++ b/t/t7002-grep.sh
@@ -14,6 +14,7 @@ int main(int argc, const char **argv)
 {
 	printf("Hello world.\n");
 	return 0;
+	/* char ?? */
 }
 EOF
 
@@ -346,11 +347,11 @@ test_expect_success 'grep from a subdirectory to search wider area (2)' '
 '
 
 cat >expected <<EOF
-hello.c:	return 0;
+hello.c:int main(int argc, const char **argv)
 EOF
 
 test_expect_success 'grep -Fi' '
-	git grep -Fi rEtUrN >actual &&
+	git grep -Fi "CHAR *" >actual &&
 	test_cmp expected actual
 '
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help