git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] completion: improve untracked directory filtering for filename completion

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Sep 19, 2013, 19:31 UTC
Message-ID
<20130919193109.GA9464@google.com>
In-Reply-To
<1379523968-20668-1-git-send-email-szeder@ira.uka.de>
SZEDER Gábor wrote:
Show 18 quoted lines
>   $ 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 <jrnieder@gmail.com>
Previous: SZEDER Gábor
Message 4 of 4 in “Bash completion doing full tree traversal?”
  1. Isaac LevySep 8, 2013
  2. Isaac LevySep 16, 2013
  3. completion: improve untracked directory filtering for filename completionSZEDER Gábor, Sep 18, 2013
  4. Jonathan NiederSep 19, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.