Re: [PATCH v1 1/1] git diff --quiet exits with 1 on clean tree with CRLF conversions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 3, 2017, 17:47 UTC
- Message-ID
- <xmqq37eu2qxl.fsf@junio-linux.mtv.corp.google.com>
- In-Reply-To
- <ae2b144a-5e39-8178-5161-1d8eb673b6f0@web.de>
Torsten Bögershausen <tboegi@web.de> writes:
Show 15 quoted lines
> Understood, thanks for the explanation. > > quiet is not quite any more.. > > Does the following fix help ? > > --- a/diff.c > +++ b/diff.c > @@ -2826,6 +2826,8 @@ int diff_populate_filespec(struct diff_filespec *s, > unsigned int flags) > enum safe_crlf crlf_warn = (safe_crlf == SAFE_CRLF_FAIL > ? SAFE_CRLF_WARN > : safe_crlf); > + if (size_only) > + crlf_warn = SAFE_CRLF_FALSE;
If you were to go this route, it may be sufficient to change its initialization from WARN to FALSE _unconditionally_, because this function uses the convert_to_git() only to _show_ the differences by computing canonical form out of working tree contents, and the conversion is not done to _write_ into object database to create a new object.
Having size_only here is not a sign of getting --quiet passed from the command line, by the way.