Re: [PATCH 0/9] respect binary attribute in grep
- From
Jeff King <peff@peff.net>
- Date
- Feb 2, 2012, 08:30 UTC
- Message-ID
- <20120202083009.GA6933@sigill.intra.peff.net>
- In-Reply-To
- <20120202081747.GA10271@sigill.intra.peff.net>
On Thu, Feb 02, 2012 at 03:17:47AM -0500, Jeff King wrote:
Show 5 quoted lines
> I implemented all of the other optimizations I mentioned except the > "only stream the first few bytes when auto-detecting binary-ness" one. > However, it should be easy to do on top of these changes. I need to > re-visit the similar change to diff_filespec_is_binary, and I'll do both > at the same time.
Oh, and I didn't even think about implementing streaming grep. The context-finding code relies on being able to backtrack through the file in memory. We _could_ implement streaming only for binary files (i.e., when we will just print "Binary file foo matches"). However, I suspect people with big binary files will want to be using "-I" anyway, so as to avoid even pulling the data from disk at all.
We might eventually want to add a config-option version of "-I" for people who have repositories of mixed source code and large binary assets.
-Peff