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

[PATCH] Git completion without a config file



Using git completion under a user account I don't normally use, it 
seemed to work fine, except I got a warning message:

fatal: error processing config file(s)

Apparently, that message is printed when running 'git config' without a 
user or system config.  The following patch silences it.

-- 
Best,
Ben

---
 Completion/Unix/Command/_git |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index c87593e..801dc9c 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -351,7 +351,7 @@ __git_aliases () {
   # out the names, skipping the values.
   # TODO: Should check if the terminal is unicode capable.  If so, use â and â
   # instead of '.
-  aliases=(${^${${(M)${(f)"$(_call_program aliases git config --list)"}:#alias.*}#alias.}/(#b)=(*)/:alias for \'$match[1]}\')
+  aliases=(${^${${(M)${(f)"$(_call_program aliases git config --list 2> /dev/null)"}:#alias.*}#alias.}/(#b)=(*)/:alias for \'$match[1]}\')
   __git_command_successful || return 0
 
   local expl
-- 
1.6.6



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