summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_git9
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fc6977178..5f6d1db43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-10-02  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
+	* 44797: Completion/Unix/Command/_git: _git-config: Complete
+	unknown options from 'git help -c'.
+
 2019-10-01  Oliver Kiddle  <okiddle@yahoo.co.uk>
 
 	* 44799: Completion/Unix/Command/_pv: new pv completion
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