Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: (3/3) _git: re-add `user-commands' support again



I’m going to change the order of the tags to be

main-porcelain-commands
user-commands
third-party-commands
…

I prefer “user-commands” as a tag name over “user-specific-commands”
as it matches the style name.

My reasoning for this order is that you always want the main porcelain
commands listed first. Then, any commands defined through the zstyle
will most likely be of most interest to the user.  Third-party
commands are tricky, however, as their relevance to the user may or
may not be high.  I think having them before
ancillary-manipulator-commands makes sense, but perhaps someone
disagrees?

On Wed, Jun 29, 2011 at 22:37, Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
> ---
>  Completion/Unix/Command/_git |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
> index ef97499..4567460 100644
> --- a/Completion/Unix/Command/_git
> +++ b/Completion/Unix/Command/_git
> @@ -4439,6 +4439,9 @@ __git_ignore_line_inside_arguments () {
>
>  (( $+functions[_git_commands] )) ||
>  _git_commands () {
> +  local -a user_commands
> +  zstyle -a ":completion:${curcontext}:" user-commands user_commands || user_commands=()
> +
>   local -a main_porcelain_commands
>   main_porcelain_commands=(
>     add:'add file contents to index'
> @@ -4604,6 +4607,7 @@ _git_commands () {
>   _describe -t plumbing-sync-helper-commands 'plumbing sync helper command' plumbing_sync_helper_commands && ret=0
>   _describe -t plumbing-internal-helper-commands 'plumbing internal helper command' plumbing_internal_helper_commands && ret=0
>   _describe -t third-party-addons 'third party addon' _git_third_party && ret=0
> +  _describe -t user-specific-commands 'user specific command' user_commands && ret=0
>   return ret
>  }



Messages sorted by: Reverse Date, Date, Thread, Author