From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH 3/4] _git-config: Run gettable-options earlier and in all codepaths.
Date: Fri, 29 Jul 2016 17:00:07 +0000 [thread overview]
Message-ID: <1469811608-3870-3-git-send-email-danielsh@tarsus.local2> (raw)
In-Reply-To: <1469811608-3870-1-git-send-email-danielsh@tarsus.local2>
No change to completions; this is preparation for the next commit.
---
Completion/Unix/Command/_git | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 4eba428..184d164 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -2454,6 +2454,11 @@ _git-config () {
user.signingkey:'default GPG key to use when creating signed tags::__git_gpg_secret_keys'
web.browser:'web browser to use::__git_browsers')
+ declare -a git_present_options # 'present' is an adjective
+ git_present_options=(
+ ${${${(0)"$(_call_program gettable-options git config -z --list)"}%%$'\n'*}//:/\\:}
+ )
+
case $state in
(section)
__git_config_sections -b '(|)' '^' section-names 'section name' $* && ret=0
@@ -2663,8 +2668,7 @@ _git-config () {
options -M 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' && ret=0
;;
(gettable-option)
- _wanted git-options expl option compadd -M 'r:|.=* r:|=*' - \
- ${${${(0)"$(_call_program gettable-options git config -z --list)"}%%$'\n'*}//:/\\:} && ret=0
+ _wanted git-options expl option compadd -M 'r:|.=* r:|=*' -a - git_present_options && ret=0
;;
(gettable-colorbool-option)
__git_config_sections -b '(|)' -a '(|)' '^color\.[^.]+$' gettable-colorbool-options option && ret=0
next prev parent reply other threads:[~2016-07-29 17:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-29 17:00 [PATCH 1/4] _git-config: Document more line noise Daniel Shahaf
2016-07-29 17:00 ` [PATCH 2/4] _git-config: No functional change: rename $git_options_static to $git_options in preparation for the after-next commit Daniel Shahaf
2016-07-29 17:00 ` Daniel Shahaf [this message]
2016-07-29 17:00 ` [PATCH 4/4] _git-config: Complete option names present in the config file Daniel Shahaf
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1469811608-3870-3-git-send-email-danielsh@tarsus.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/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://git.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).