Subject: Re: [PATCH] git-completion.bash: always swallow error output of for-each-ref

From: Junio C Hamano <[email-masked]>
Date: Fri, 12 Feb 2016 12:26:24 -0800

Jeff King <[email-masked]> writes:

> I agree it's a lot more pleasant, assuming there are no cases where we
> would want to pass through an error. But I really cannot think of one.
> Even explosive "woah, your git repo is totally corrupted" messages
> probably should be suppressed in the prompt.
>
>> @@ -320,7 +320,7 @@ __git_heads ()
>>  			refs/heads
>>  		return
>>  	fi
>> -}
>> +} 2>/dev/null
>
> Today I learned about yet another fun corner of POSIX shell.

I may have learned about this soon after I started learning bash,
but I admit that this was the first time I found a practical use
case for it ;-).