about summary refs log tree commit diff
path: root/Completion/Unix/Command/_git
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2019-09-30 16:51:11 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2019-10-02 17:11:11 +0000
commitdca638e3011eb53e7cad054d1886eb65b9e882de (patch)
tree20c7478845368e1fb658a7cd7dd031bc8edd7e7b /Completion/Unix/Command/_git
parent0cc98dfe055705507707a38d01afe8e14fd40529 (diff)
downloadzsh-dca638e3011eb53e7cad054d1886eb65b9e882de.tar.gz
zsh-dca638e3011eb53e7cad054d1886eb65b9e882de.tar.xz
zsh-dca638e3011eb53e7cad054d1886eb65b9e882de.zip
44797: _git-config: Complete unknown options from 'git help -c'.
Diffstat (limited to 'Completion/Unix/Command/_git')
-rw-r--r--Completion/Unix/Command/_git9
1 files changed, 8 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 29fa379a7..873b13e5b 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -2886,9 +2886,16 @@ __git_config_option-or-value () {
   declare -a git_present_options # 'present' is an adjective
   git_present_options=(
     ${${${(0)"$(_call_program gettable-options git config -z --list)"}%%$'\n'*}//:/\\:}
+
+    # Remove the "'git help config' for more information" line.
+    #
+    # Change literal 'foo.<bar>.baz' to 'foo.*.baz'. With that, completing
+    # at  foo.lorem.<TAB>  will offer foo.lorem.baz.
+    ${${${(f)"$(_call_program all-known-options "git help -c")"}:#* *}/<*>/*}
   )
 
-  # Add to $git_options options from the config file that aren't already in $git_options.
+  # Add to $git_options options from the config file, and from 'git help -c',
+  # that aren't already in $git_options.
   () {
     local -a -U sections_that_permit_arbitrary_subsection_names=(
       alias