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 '