diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2017-03-23 16:29:24 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-23 11:18:23 -0700 |
commit | 227307a639c96b3579b7fe60840fdae123d1ee88 (patch) | |
tree | 5968a3f725d7fcd6452bc5f4638b53cb54ee36ca /contrib/coccinelle | |
parent | completion: fill COMPREPLY directly when completing fetch refspecs (diff) | |
download | tgif-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 'contrib/coccinelle')
0 files changed, 0 insertions, 0 deletions