git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: Isaac Levy <ilevy@google.com>,
	git@vger.kernel.org, Manlio Perillo <manlio.perillo@gmail.com>
Subject: Re: [PATCH] completion: improve untracked directory filtering for filename completion
Date: Thu, 19 Sep 2013 12:31:10 -0700	[thread overview]
Message-ID: <20130919193109.GA9464@google.com> (raw)
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 <jrnieder@gmail.com>

      reply	other threads:[~2013-09-19 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-08 12:12 Bash completion doing full tree traversal? Isaac Levy
2013-09-16 15:54 ` Isaac Levy
2013-09-18 17:06   ` [PATCH] completion: improve untracked directory filtering for filename completion SZEDER Gábor
2013-09-19 19:31     ` Jonathan Nieder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130919193109.GA9464@google.com \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ilevy@google.com \
    --cc=manlio.perillo@gmail.com \
    --cc=szeder@ira.uka.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).