Re: [PATCH] add--interactive: do not expand pathspecs with ls-files

2017-03-14 Thread Jeff King
On Tue, Mar 14, 2017 at 03:03:34PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > We can improve this by skipping "ls-files" completely, and > > just feeding the original pathspecs to the diff commands. > > This solution was discussed in 2010: > > > > > > http://public-inbox.org/git/2

Re: [PATCH] add--interactive: do not expand pathspecs with ls-files

2017-03-14 Thread Junio C Hamano
Jeff King writes: > We can improve this by skipping "ls-files" completely, and > just feeding the original pathspecs to the diff commands. > This solution was discussed in 2010: > > http://public-inbox.org/git/20100105041438.gb12...@coredump.intra.peff.net/ > > but at the time the diff code's p

Re: [PATCH] add--interactive: do not expand pathspecs with ls-files

2017-03-14 Thread Jeff King
On Tue, Mar 14, 2017 at 10:25:04AM -0700, Brandon Williams wrote: > On 03/14, Jeff King wrote: > > b. If the repository contains filenames with literal wildcard > > characters (e.g., "foo*"), the original code expanded > > them via "ls-files" and then fed those wildcard names > >

Re: [PATCH] add--interactive: do not expand pathspecs with ls-files

2017-03-14 Thread Brandon Williams
On 03/14, Jeff King wrote: > b. If the repository contains filenames with literal wildcard > characters (e.g., "foo*"), the original code expanded > them via "ls-files" and then fed those wildcard names > to "diff-index", which would have treated them as > wildcards. This was

Re: [PATCH] add--interactive: do not expand pathspecs with ls-files

2017-03-14 Thread Jeff King
On Tue, Mar 14, 2017 at 12:30:24PM -0400, Jeff King wrote: > 2. Even when it does work, it's really slow. The pathspec > code is not optimized for huge numbers of paths. Here's > the same case without the ulimit: > >$ time git add -p drivers >No changes. > >re

[PATCH] add--interactive: do not expand pathspecs with ls-files

2017-03-14 Thread Jeff King
When we want to get the list of modified files, we first expand any user-provided pathspecs with "ls-files", and then feed the resulting list of paths as arguments to "diff-index" and "diff-files". If your pathspec expands into a large number of paths, you may run into one of two problems: 1. Th