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

[PATCH] _git-config: When an option is unknown, complete its value to the set value.



---
 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 5b64dda..1108087 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -2621,7 +2621,7 @@ __git_config_option-or-value () {
           # If $key isn't an instance of a known foo.*.bar:baz $git_options entry...
           if ! (( ${+git_options[(r)(#i)${(b)key%%.*}.[*].${(b)key##*.}:*]} )); then
             # ... then add it.
-            git_options+="${key}:unknown option name"
+            git_options+="${key}:unknown option name::->unknown"
           fi
         else
           # $key is of the form "foo.bar" where 'foo' is known
@@ -2630,7 +2630,7 @@ __git_config_option-or-value () {
           continue
         fi
       else
-        git_options+="${key}:unknown option name"
+        git_options+="${key}:unknown option name::->unknown"
       fi
     done
   }
@@ -3231,6 +3231,10 @@ __git_config_option-or-value () {
                 'values:value:(user)' \
                 'umasks: :__git_guard_number umask' && ret=0
               ;;
+            (unknown)
+              _message "$line[1] option value"
+              compadd - $current && ret=0
+              ;;
           esac
           ;;
         (*)



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