Re: [RFC] sending errors to stdout under $PAGER
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 17, 2008, 17:56 UTC
- Message-ID
- <7vd4qv1n78.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080217144854.56fcb98d.froese@gmx.de>
Edgar Toernig <froese@gmx.de> writes:
Show 18 quoted lines
> Junio C Hamano wrote: >> >> + FILE *outto = (pager_in_use() ? stdout : stderr); >> + >> vsnprintf(msg, sizeof(msg), err, params); >> - fprintf(stderr, "%s%s\n", prefix, msg); >> + fprintf(outto, "%s%s\n", prefix, msg); >> >> What do people think? Have I overlooked any downsides? > > Wouldn't it be better/safer to redirect stderr to the pager > in the first place? > > So, instead of the current > > foo | less > use > foo 2>&1 | less
I like it. Much nicer. Thanks.