Re: [PATCH] git-completion.bash: always swallow error output of for-each-ref
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 12, 2016, 20:26 UTC
- Message-ID
- <xmqqoablu13j.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160212201002.GA21598@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> 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 ;-).