Re: [PATCH 2/2] do not stream large files to pack when filters are in use
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 24, 2012, 20:03 UTC
- Message-ID
- <7vehtkyp6i.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20120224094805.GB11846@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I'm on the fence about the performance regression above. On the one > hand, if you're telling git to autocrlf your gigantic binary files, you > should fix your attributes, and expect not to use the streaming > optimization until you do.
That is a sensible angle to view the issue from, I would think.
Show 11 quoted lines
> diff --git a/sha1_file.c b/sha1_file.c > index f9f8d5e..61f597b 100644 > --- a/sha1_file.c > +++ b/sha1_file.c > @@ -2720,7 +2720,8 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, > > if (!S_ISREG(st->st_mode)) > ret = index_pipe(sha1, fd, type, path, flags); > - else if (size <= big_file_threshold || type != OBJ_BLOB) > + else if (size <= big_file_threshold || type != OBJ_BLOB || > + convert_to_git(path, NULL, 0, NULL, 0))
Nice. It would be even nicer to give a readability macro whose name makes it clear that this is a query (unfortunately we cannot add '?' at the end of the function name) and not a conversion. Any name suggestions?
By the way, I tried this with the tip of 'pu' as of last night, and the result segfaults on me in t1050 (hash-object -w) ;-).