From: Junio C Hamano <hidden> Date: 2016-06-15 22:48:00
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 <redacted>
---
* Fix for a longstanding bug meant for maint.
builtin-grep.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
Heya,
On Wed, Jan 13, 2010 at 07:56, Junio C Hamano [off-list ref] wrote:
It's Ok as the price we pay for producing correct result is to open those
empty files, read them, and look for matches which we will never find ;-)
I'm not that familiar with the code, but wouldn't it be possible to
keep the early abort, but make it dependent on not using the '-L'
flag?
--
Cheers,
Sverre Rabbelier
From: Junio C Hamano <hidden> Date: 2016-06-15 22:48:00
Sverre Rabbelier [off-list ref] writes:
I'm not that familiar with the code, but wouldn't it be possible to
keep the early abort, but make it dependent on not using the '-L'
flag?
Anything codable is possible to code, but my point was I don't think such
an optimization to avoid reading empty files is worth the time to write
and maintain extra code necessary for it.