Re: [PATCH] grep: do not do external grep on skip-worktree entries
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 2, 2010, 19:45 UTC
- Message-ID
- <7v7hs09tpi.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <fcaeb9bf1001021115j7b23264n42cfba7855c2253e@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 17 quoted lines
>> > +support_external_grep() {
>> > + case "$(git grep -h 2>&1 >/dev/null|grep -e --ext-grep)" in
>> > + *"(default)"*) return 0;;
>> > + *"(ignored by this build)"*) return 1;;
>> > + *) test_expect_success 'External grep check is broken' 'false';;
>> > + esac
>> > +}
>>
>>
>> Heh, clever.
>>
>> git grep -h 2>&1 | grep 'allow calling of grep.*default' >/dev/null
>>
>> may be sufficient, though.
>
> Yes, until somebody changes help text in builtin-grep.c and all
> external grep tests become disable. I wanted to catch that case too.Ok, that is a worthwhile thing to do.
Then please at least make the second grep "grep ext-grep", droping "-e --" from it. We assume some implementation of external grep to lack "-e" (e.g. Solaris).