From: Junio C Hamano Date: Sat, 02 Jan 2010 19:45:29 GMT Subject: Re: [PATCH] grep: do not do external grep on skip-worktree entries Message-ID: <7v7hs09tpi.fsf@alter.siamese.dyndns.org> In-Reply-To: Nguyen Thai Ngoc Duy writes: >> > +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).