Re: [PATCH] diff: do not reuse worktree files that need "clean" conversion

2016-07-22 Thread Junio C Hamano
Jeff King writes: > So I think we actually _can_ think of would_convert_to_git() as > basically free. Or as free as other efficient-lookup functions we call > like cache_name_pos(). OK. > The thought "does this tree reuse even speed things up enough to justify > its complexity"

Re: [PATCH] diff: do not reuse worktree files that need "clean" conversion

2016-07-22 Thread Jeff King
On Fri, Jul 22, 2016 at 10:44:08AM -0700, Junio C Hamano wrote: > > diff --git a/diff.c b/diff.c > > index 7d03419..b43d3dd 100644 > > --- a/diff.c > > +++ b/diff.c > > @@ -2683,6 +2683,13 @@ static int reuse_worktree_file(const char *name, > > const unsigned char *sha1, int > > if

Re: [PATCH] diff: do not reuse worktree files that need "clean" conversion

2016-07-22 Thread Junio C Hamano
Jeff King writes: > Subject: diff: do not reuse worktree files that need "clean" conversion > > 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

[PATCH] diff: do not reuse worktree files that need "clean" conversion

2016-07-22 Thread Jeff King
On Thu, Jul 21, 2016 at 05:37:40PM -0400, Jeff King wrote: > The next three are to show the final diffstat after the commit > completes. It looks like the "should we reuse the worktree file?" > optimization in diff_populate_filespec() does not take into account > whether we will have to convert