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

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

From
Jeff King <peff@peff.net>
Date
Feb 17, 2008, 12:35 UTC
Message-ID
<20080217123538.GB26031@sigill.intra.peff.net>
In-Reply-To
<7vbq6g90gy.fsf@gitster.siamese.dyndns.org>
On Sat, Feb 16, 2008 at 11:15:41AM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> Because we spawn the pager as the foreground process and feed
> its input via pipe from the real command, we cannot affect the
> exit status the shell sees from git command when the pager is in
> use (I think there is not much gain we can have by working it
> around, though).  But at least it may make sense to show the
> error message to the user sitting in front of the pager, perhaps
> like this.
> 
> What do people think?  Have I overlooked any downsides?

I think this makes sense. It could be annoying if chatty stderr output got mixed in with the actual output, making things harder to read. But git is not very chatty in general, and the point is that things sent to stderr _should_ grab the user's attention.

The only downside I see is that it disrupts the parsing of the output. In most cases, this doesn't matter, since anything parsing the output will disable the pager. The notable exception is something like 'tig', which I believe can act as a git pager which understands the output; it can potentially be confused by the extra lines on stdout.

-Peff
Previous: Shawn O. PearceNext: Edgar Toernig
Message 3 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.