author | Junio C Hamano <gitster@pobox.com> | |
Tue, 12 Jan 2010 08:22:23 +0000 (00:22 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 12 Jan 2010 08:47:02 +0000 (00:47 -0800) | ||
commit | fbb9971aca1fef66e622d64418121f6077f05c57 | |
tree | dd328fa4a9d9b4b74214698e2da55cb5f18a331c | tree | snapshot |
parent | 2b77029f4ad556b82cdbadf59ae13d41e23b6e7c | commit | diff |
grep: -L should show empty files
The -L (--files-without-match) option is supposed to show paths that
produced no matches. When running the internal grep on work tree files,
however, we had an optimization to just return on zero-sized files,
without doing anything.
This optimization doesn't matter too much in practice (a tracked empty
file must be rare, or there is something wrong with your project); to
produce results consistent with GNU grep, we should stop the optimization
and show empty files as not having the given pattern.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The -L (--files-without-match) option is supposed to show paths that
produced no matches. When running the internal grep on work tree files,
however, we had an optimization to just return on zero-sized files,
without doing anything.
This optimization doesn't matter too much in practice (a tracked empty
file must be rare, or there is something wrong with your project); to
produce results consistent with GNU grep, we should stop the optimization
and show empty files as not having the given pattern.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-grep.c | diff | blob | history |