From: Jonathan Nieder Date: Thu, 19 Sep 2013 19:31:10 GMT Subject: Re: [PATCH] completion: improve untracked directory filtering for filename completion Message-ID: <20130919193109.GA9464@google.com> In-Reply-To: <1379523968-20668-1-git-send-email-szeder@ira.uka.de> SZEDER Gábor wrote: > $ time __git_index_files "--others --modified" > untracked-dir > > real 0m0.537s > user 0m0.452s > sys 0m0.160s > > Eliminate this delay by additionally passing the '--directory > --no-empty-directory' options to 'git ls-files' to show only the > directory name of non-empty untracked directories instead their whole > content: > > $ time __git_index_files "--others --modified --directory --no-empty-directory" > untracked-dir > > real 0m0.029s > user 0m0.020s > sys 0m0.004s Nice. This is what "git status" uses, too. > Filename completion for 'git clean' suffers from the same delay, as it > offers untracked files, too. The fix could be the same, but since it > actually makes sense to 'git clean' empty directories, in this case we > only pass the '--directory' option to 'git ls-files'. Also sensible. For what it's worth, Reviewed-by: Jonathan Nieder