git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] sending errors to stdout under $PAGER

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 17, 2008, 15:15 UTC
Message-ID
<alpine.LSU.1.00.0802171515190.30505@racer.site>
In-Reply-To
<20080217144854.56fcb98d.froese@gmx.de>
Hi,
On Sun, 17 Feb 2008, Edgar Toernig wrote:
Show 23 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?
> 
> [...]
>
>          /* return in the child */
>         if (!pid) {
>                 dup2(fd[1], 1);
> +               dup2(fd[1], 2);
>                 close(fd[0]);
>                 close(fd[1]);
>                 return;
>         }
I like it.

Ciao, Dscho

Previous: Edgar ToernigNext: Junio C Hamano
Message 5 of 9 in “[RFC] sending errors to stdout under $PAGER”
  1. Junio C HamanoFeb 16, 2008
  2. Shawn O. PearceFeb 17, 2008
  3. Jeff KingFeb 17, 2008
  4. Edgar ToernigFeb 17, 2008
  5. Johannes SchindelinFeb 17, 2008
  6. Junio C HamanoFeb 17, 2008
  7. Jeff KingFeb 17, 2008
  8. Junio C HamanoFeb 17, 2008
  9. Johannes SchindelinFeb 17, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.