Junio C Hamano <gits...@pobox.com> writes:

> But diff.<driver>.textconv is to mangle blob contents in preparation
> for comparing with another.

and also in preparation for "blame".

In both cases (diff and blame), we're preparing to show the file content
to the user, and showing the binary makes no sense.

Grepping through the binary, on the other hand, can very well make
sense, like:

$ git grep foo
file.txt: some instance of foo
binary file bar.bin matches

One reason not to run the filter is performance: "git grep" is fast, and
it's cool. My textconv filters are usually slow, and it's not a big
problem because the diff machinery will only invoke the textconv filter
when the files are modified (i.e. hopefully not often for tracked binary
files). OTOH, "git grep" would need to run the textconv filters for each
binary files being searched for.

I tend to agree with Junio that it makes sense to keep it disabled by
default. Perhaps a grep.textconv config option?

Matthieu Moy
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to