Re: [RFC/PATCH v4 6/6] completion: add public _GIT_complete helper
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:46
Felipe Contreras [off-list ref] writes:
quoted hunk
So that users can easily define aliases, such as: _GIT_complete gf git_fetch Signed-off-by: Felipe Contreras <redacted> --- contrib/completion/git-completion.bash | 10 +++++----- t/t9902-completion.sh | 9 ++++++++- 2 files changed, 13 insertions(+), 6 deletions(-)diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 049110e..2b7ef02 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash@@ -2678,6 +2678,7 @@ _gitk () __git_func_wrap () { + local cmd="${1#git_}" cmd_pos=1 if [[ -n ${ZSH_VERSION-} ]]; then emulate -L bash setopt KSH_TYPESET@@ -2695,8 +2696,7 @@ __git_func_wrap () _$1 } -# this is NOT a public function; use at your own risk -__git_complete () +_GIT_complete ()
If it is now a public function, please have some description as to how to use it for people who find this in the tarball extract. I am guessing that _GIT_complete frotz git_fetch is a way to declare that 'git frotz' wants the same kind of completion as 'git fetch' command, but I am not sure, as if it were the case it strikes me somewhat odd that it is not "_GIT_complete frotz fetch".