From: Shawn O. Pearce Date: Thu, 07 May 2009 15:12:07 GMT Subject: Re: [PATCH 3/3] completion: use specified file (if any) when completing config vars Message-ID: <20090507151207.GQ30527@spearce.org> In-Reply-To: <1241677093-29937-2-git-send-email-bebarino@gmail.com> Stephen Boyd 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 You'll complete against --global, not the local repository. > __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.