diff options
author | Jeff King <peff@peff.net> | 2016-07-22 11:27:53 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-22 12:31:24 -0700 |
commit | 06dec439a3d00fa0b3141a2d52b33d22b941976c (patch) | |
tree | 4e0b7ad23778a7fb4264f6e21886095068c85b72 /git.rc | |
parent | 0b65a8dbdb38962e700ee16776a3042beb489060 (diff) | |
download | git-jk/diff-do-not-reuse-wtf-needs-cleaning.tar.gz |
diff: do not reuse worktree files that need "clean" conversionjk/diff-do-not-reuse-wtf-needs-cleaning
When accessing a blob for a diff, we may try to reuse file
contents in the working tree, under the theory that it is
faster to mmap those file contents than it would be to
extract the content from the object database.
When we have to filter those contents, though, that
assumption does not hold. Even for our internal conversions
like CRLF, we have to allocate and fill a new buffer anyway.
But much worse, for external clean filters we have to exec
an arbitrary script, and we have no idea how expensive it
may be to run.
So let's skip this optimization when conversion into git's
"clean" form is required. This applies whenever the
"want_file" flag is false. When it's true, the caller
actually wants the smudged worktree contents, which the
reused file by definition already has (in fact, this is a
key optimization going the other direction, since reusing
the worktree file there lets us skip smudge filters).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git.rc')
0 files changed, 0 insertions, 0 deletions