From: Junio C Hamano Date: Mon, 04 Jan 2016 19:30:48 GMT Subject: Re: [PATCH v2 16/17] grep: read -f file with strbuf_getline_crlf() Message-ID: In-Reply-To: Johannes Schindelin writes: > Having said that, `grep` operates on lines of text, Correct. > and CR is established as a non-text byte, Correct but only if you are a pedant. With this patch, you can no longer find "A" on a "line" that is "A", which is a regression on a system whose native line ermination convention is to use a single LF at the end. The thing is, users know "grep -e '' finds hits with a line with the non-text byte, and telling them that they shouldn't rely on the feature would not make the world a better place. This patch limits the damage by restricting the special casing of CR only at the end of the line just before LF, so we can still find "AB" on a "line" that has a non-text byte, e.g. "AB" or "AB". It is just a at the end of the line (with or without any other string before it) for which we see a regression, and I suspect that it would be a small enough price to accept to help those who would need to work with systems.