Re: [PATCH v3 5/6] diff --stat: mark any file larger than core.bigfilethreshold binary
On Wed, Aug 13, 2014 at 6:57 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
Show 27 quoted lines
> Too large files may lead to failure to allocate memory. If it happens
> here, it could impact quite a few commands that involve
> diff. Moreover, too large files are inefficient to compare anyway (and
> most likely non-text), so mark them binary and skip looking at their
> content.
>
> Noticed-by: Dale R. Worley <worley@alum.mit.edu>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> Documentation/config.txt | 3 ++-
> Documentation/gitattributes.txt | 4 ++--
> diff.c | 26 ++++++++++++++++++--------
> diffcore.h | 1 +
> t/t1050-large.sh | 4 ++++
> 5 files changed, 27 insertions(+), 11 deletions(-)
>
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index c55c22a..53df40e 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -499,7 +499,8 @@ core.bigFileThreshold::
> Files larger than this size are stored deflated, without
> attempting delta compression. Storing large files without
> delta compression avoids excessive memory usage, at the
> - slight expense of increased disk usage.
> + slight expense of increased disk usage. Additionally files
> + larger than this size are allways treated as binary.
> Default is 512 MiB on all platforms. This should be reasonable
> for most projects as source code and other text files can still