summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-05-27 18:28:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-29 05:51:29 (GMT)
commitf22f682695d8f1bf79cde44cfe0b913905c1ef9a (patch)
tree892fc933b4fc2cb2b5b5466bc6708df3591af937 /contrib/completion/git-completion.bash
parent09c4ba410b0fda5a82dc5a9b71bfd4967927e6ca (diff)
downloadgit-f22f682695d8f1bf79cde44cfe0b913905c1ef9a.zip
git-f22f682695d8f1bf79cde44cfe0b913905c1ef9a.tar.gz
git-f22f682695d8f1bf79cde44cfe0b913905c1ef9a.tar.bz2
completion: complete general config vars in two steps
There are 581 config variables as of now when you do "git config <tab>" which can fill up a few screens and is not very helpful when you have to look through columns of text to find what you want. This patch instead shows you only first level when you do git config <tab> There are 78 items, which use up 8 rows in my screen. Compared to screens of text, it's pretty good. Once you have chosen you first level, e.g. color: git config color.<tab> will show you all color.* This is not a new idea. branch.* and remote.* completion already does this for second and third levels. For those variables, you'll need to <tab> three times to get full variable name. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rw-r--r--contrib/completion/git-completion.bash9
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 97776fb..a6f55e8 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2158,9 +2158,14 @@ _git_config ()
__gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur_"
return
;;
+ *.*)
+ __git_compute_config_vars
+ __gitcomp "$__git_config_vars"
+ ;;
+ *)
+ __git_compute_config_vars
+ __gitcomp "$(echo "$__git_config_vars" | sed 's/\.[^ ]*/./g')"
esac
- __git_compute_config_vars
- __gitcomp "$__git_config_vars"
}
_git_remote ()