Re: [PATCH 4/4] diff: mark any file larger than core.bigfilethreshold binary
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 23, 2014, 12:18 UTC
- Message-ID
- <CACsJy8A5StEv4O64rnd39+1jMNWiaAv4oOd0+Yko_JPuk6EYZw@mail.gmail.com>
- In-Reply-To
- <1403180845.10052.16.camel@thomas-debian-x64>
On Thu, Jun 19, 2014 at 7:27 PM, Thomas Braun <thomas.braun@virtuell-zuhause.de> wrote:
Show 12 quoted lines
>> @@ -2721,6 +2721,11 @@ int diff_populate_filespec(struct diff_filespec *s, unsigned int flags)
>> }
>> if (size_only)
>> return 0;
>> + if ((flags & DIFF_POPULATE_IS_BINARY) &&
>> + s->size > big_file_threshold && s->is_binary == -1) {
>> + s->is_binary = 1;
>> + return 0;
>> + }
>
> Why do you check for s->is_binary == -1 here? I think it does not matter
> what s_is_binary says here.If some .gitattributes to mark one file not-binary, we should respect that, I think. Same for below too.
Show 16 quoted lines
> I would also add a note to the documentation e. g: > > diff --git a/Documentation/config.txt b/Documentation/config.txt > index 9f467d3..7a2f27d 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
Thanks. Will do. Sorry a little busy these days and could not reply earlier.
-- Duy