Re: [RFC/PATCH v4 6/6] completion: add public _GIT_complete helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Felipe Contreras <felipe.contreras@xxxxxxxxx> writes:

> So that users can easily define aliases, such as:
>
>  _GIT_complete gf git_fetch
>
> Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
> ---
>  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".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]