Re: [PATCH 3/3] completion: use specified file (if any) when completing config vars
Stephen Boyd <bebarino@gmail.com> wrote:
> Only list the variables that can actually be affected by the command by
> searching the arguments for a config file setting.
Wow, this is a lot of magic.
Try:
git config --global remote.gitster.url $(git config remote.o<TAB>
You'll complete against --global, not the local repository.
Show 7 quoted lines
> __git_config_get_set_variables ()
> {
> - for i in $(git --git-dir="$(__gitdir)" config --list); do
> + local args="--global --system --file= -f"
> + local config_file="$(__git_find_argument_and_value "$args")"
> + for i in $(git --git-dir="$(__gitdir)" config $config_file --list \
> + 2>/dev/null); do--
Shawn.