]> git.ipfire.org Git - thirdparty/git.git/commit - contrib/completion/git-completion.bash
git-completion.bash: introduce __gitcomp_builtin
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Fri, 9 Feb 2018 11:01:43 +0000 (18:01 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Feb 2018 18:24:50 +0000 (10:24 -0800)
commitd401f3debc5807092d68c95a89b363b65bbc8947
tree707ecfa80065dd7851a2d5fb0344d42de72cbe4d
parent1224781d6080b8b69a81526ee23b22a1587920ea
git-completion.bash: introduce __gitcomp_builtin

This is a __gitcomp wrapper that will execute

    git ... --git-completion-helper

to get the list of completable options. The call will be made only
once and cached to avoid performance issues, especially on Windows.

__gitcomp_builtin() allows callers to change its output a bit by adding
some more options, or removing some.

- Current --git-completion-helper for example does not output --no-foo
  form, this has to be added manually by __gitcomp_builtin() callers
  when necessary

- Some options from --git-completion-helper should only be available in
  certain conditions (e.g. --continue and friends). __gitcomp_builtin()
  callers can remove them if the conditions are not met.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash