diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2017-03-23 16:29:20 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-23 11:18:22 -0700 |
commit | 824388d54b238b0d0cdc3f584dd27cb334df4ebc (patch) | |
tree | 47f19c41d58200f7282088c8f80f0d94c53583bb /exec_cmd.c | |
parent | completion: let 'for-each-ref' strip the remote name from remote branches (diff) | |
download | tgif-824388d54b238b0d0cdc3f584dd27cb334df4ebc.tar.xz |
completion: let 'for-each-ref' filter remote branches for 'checkout' DWIMery
The code listing unique remote branches for 'git checkout's tracking
DWIMery outputs only remote branches that match the current word to be
completed, but the filtering is done in a shell loop iterating over
all remote refs.
Let 'git for-each-ref' do the filtering, as it can do so much more
efficiently and we can remove that shell loop entirely.
This speeds up refs completion for 'git checkout' considerably when
there are a lot of non-matching remote refs to be filtered out.
Uniquely completing a branch in a repository with 100k remote
branches, all packed, best of five:
On Linux, before:
$ time __git_complete_refs --cur=maste --track
real 0m1.993s
user 0m1.740s
sys 0m0.304s
After:
real 0m0.266s
user 0m0.248s
sys 0m0.012s
On Windows, before:
real 0m6.187s
user 0m3.358s
sys 0m2.121s
After:
real 0m0.750s
user 0m0.015s
sys 0m0.090s
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'exec_cmd.c')
0 files changed, 0 insertions, 0 deletions