git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Terry via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Terry <tmoschou@gmail.com>
Subject: Re: [PATCH] complete: zsh: add missing sub cmd completion candidates
Date: Fri, 17 Apr 2020 11:24:01 -0700	[thread overview]
Message-ID: <xmqqsgh2ug1q.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <pull.613.git.1587107464322.gitgitgadget@gmail.com> (Terry via GitGitGadget's message of "Fri, 17 Apr 2020 07:11:04 +0000")

"Terry via GitGitGadget" <gitgitgadget@gmail.com> 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.

  reply	other threads:[~2020-04-17 18:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17  7:11 [PATCH] complete: zsh: add missing sub cmd completion candidates Terry via GitGitGadget
2020-04-17 18:24 ` Junio C Hamano [this message]
2020-10-25  3:35   ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqsgh2ug1q.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=tmoschou@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).