summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar SZEDER Gábor <szeder.dev@gmail.com>2017-03-23 16:29:24 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-03-23 11:18:23 -0700
commit227307a639c96b3579b7fe60840fdae123d1ee88 (patch)
tree5968a3f725d7fcd6452bc5f4638b53cb54ee36ca /t
parentcompletion: fill COMPREPLY directly when completing fetch refspecs (diff)
downloadtgif-227307a639c96b3579b7fe60840fdae123d1ee88.tar.xz
completion: speed up branch and tag completion
Modify __git_heads() and __git_tags() and the few callsites they have, so we can let 'git for-each-ref' do all the hard work and these functions' output won't need any further processing or filtering before being handed over to Bash, resulting in faster branch and tag completion. These are some of the same tricks used in the previous commits to speed up refs completion, namely: - Extend both functions to accept prefix, current word and suffix positional parameters, all optional and all empty by default to keep the parameterless behavior unaltered. - Specify appropriate globbing patterns to 'git for-each-ref' to list only branches or tags matching the given current word parameter. - Modify the 'git for-each-ref --format=<...>' to include the given prefix and suffix. - Adjust all callsites to specify the proper prefix, current word and suffix parameters, and to fill COMPREPLY using __gitcomp_direct(). Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
0 files changed, 0 insertions, 0 deletions