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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 17, 2009, 00:06 UTC
Message-ID
<7v639am2uq.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vocn2m48d.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 11 quoted lines
> 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
 '
 
Previous: Junio C HamanoNext: Jeff King
Message 12 of 13 in “RFC Allow case insensitive search flag with git-grep for fixed-strings”
  1. RFC Allow case insensitive search flag with git-grep for fixed-stringsBrian Collins, Oct 30, 2009
  2. Jeff KingNov 6, 2009
  3. Brian CollinsNov 6, 2009
  4. Junio C HamanoNov 6, 2009
  5. Jeff KingNov 6, 2009
  6. Junio C HamanoNov 7, 2009
  7. Nanako ShiraishiNov 16, 2009
  8. Jeff KingNov 16, 2009
  9. Brian CollinsNov 16, 2009
  10. Brandon CaseyNov 16, 2009
  11. Junio C HamanoNov 16, 2009
  12. Junio C HamanoNov 17, 2009
  13. Jeff KingNov 17, 2009

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.