Re: [PATCH v1 1/1] git diff --quiet exits with 1 on clean tree with CRLF conversions
- From
Jeff King <peff@peff.net>
- Date
- Mar 2, 2017, 19:12 UTC
- Message-ID
- <20170302191201.nhhucl44dwmcqkb4@sigill.intra.peff.net>
- In-Reply-To
- <xmqqmvd3d0ru.fsf@gitster.mtv.corp.google.com>
On Thu, Mar 02, 2017 at 09:52:21AM -0800, Junio C Hamano wrote:
Show 13 quoted lines
> >> + * and is_binary check being that we want to avoid
> >> + * opening the file and inspecting the contents, this
> >> + * is probably fine.
> >> + */
> >> if ((flags & CHECK_BINARY) &&
> >> s->size > big_file_threshold && s->is_binary == -1) {
> >> s->is_binary = 1;
> >
> > I'm trying to think how this "not strictly correct" could bite us.
>
> Note that the comment is just documenting what I learned and thought
> while working on an unrelated thing that happened to be sitting next
> to it.Yeah, sorry, this is obviously not a blocker to your patch. I'm just wondering if there is more work needed.
> To be quite honest, I do not think this code should cater to LFS or > any other conversion hack. They all install their own diff driver > and they can tell diff_filespec_is_binary() if the thing is binary > or not without falling back to this heuristics codepath.
Yeah, you're right, I was just being silly. Whatever configured the filter already has an opportunity to give us this knowledge in a better way, and we should rely on that.
-Peff