Re: [PATCH] complete: zsh: add missing sub cmd completion candidates

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

 



"Terry via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
> index eef4eff53df..ce47e86b60c 100644
> --- a/contrib/completion/git-completion.zsh
> +++ b/contrib/completion/git-completion.zsh
> @@ -150,9 +150,11 @@ __git_zsh_cmd_common ()
>  	push:'update remote refs along with associated objects'
>  	rebase:'forward-port local commits to the updated upstream head'
>  	reset:'reset current HEAD to the specified state'
> +	restore:'restore working tree files'
>  	rm:'remove files from the working tree and from the index'
>  	show:'show various types of objects'
>  	status:'show the working tree status'
> +	switch:'switch branches'
>  	tag:'create, list, delete or verify a tag object signed with GPG')
>  	_describe -t common-commands 'common commands' list && _ret=0
>  }

This is not a new issue, but it makes me wonder if we can initialize
this list just once by running "git help" and picking up pieces from
it.  That way, we won't have to maintain this hardcoded list at all,
no?

And if it is cumbersome to parse "git help" output, I do not think
it is a worse solution than having to maintain the above list
manually to add a new "--list-common-commands-for-zsh-completion"
option to "git help" to produce something more easily parseable.

In any case, the patch is probably an improvement to make the list
closer to what "git help" considers "common commands", but in the
longer term, it may not be making it any better for maintainability.

Thanks.



[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]

  Powered by Linux