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

Re: [PATCH 1/3] test-terminal: give the child an empty stdin TTY

From
Thomas Rast <trast@student.ethz.ch>
Date
Dec 12, 2011, 18:34 UTC
Message-ID
<201112121934.40953.trast@student.ethz.ch>
In-Reply-To
<20111212181915.GD31793@elie.hsd1.il.comcast.net>
Jonathan Nieder wrote:
Show 18 quoted lines
> Hi,
> 
> Thomas Rast wrote:
> > -# Run @$argv in the background with stdio redirected to $out and $err.
> > +# Run @$argv in the background with stdio redirected from $in and to $out and $err.
> 
> I'm not thrilled about this change.  The original purpose of
> test_terminal was to test commands like "git log" that need to check
> whether stdout is a tty in order to decide whether to use color and to
> paginate their output.  Perhaps whether stdin is a tty _should_ affect
> those decisions, but it currently doesn't (for example, "echo HEAD |
> git log --stdin" works) and that would deserve a separate test, I'd
> think.
> 
> The testsuite bug you mentioned sounds like a real one and worth
> fixing, though.  Maybe there would be some way for test_terminal to
> give the caller some control over which file descriptors to replace
> with a terminal.

I'm not sure I understand what you are arguing for or why. That I avoid wasting a Pty, and only replace stdin with /dev/null?

(Because with the current state of the tests, this shouldn't make much of a difference. I just figured I should go all the way and give commands an environment that really looks like they'd been called from the terminal.)

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Jonathan NiederNext: Jonathan Nieder
Message 9 of 16 in “test-terminal: give the child an empty stdin TTY”
  1. 1/3 test-terminal: give the child an empty stdin TTYThomas Rast, Dec 12, 2011
  2. 2/3 test-terminal: set output terminals to raw modeThomas Rast, Dec 12, 2011
  3. Jonathan NiederDec 12, 2011
  4. Thomas RastDec 12, 2011
  5. Jonathan NiederDec 13, 2011
  6. 3/3 t/lib-terminal: test test-terminal's sanityThomas Rast, Dec 12, 2011
  7. Jonathan NiederDec 12, 2011
  8. Jonathan NiederDec 12, 2011
  9. Thomas RastDec 12, 2011
  10. Jonathan NiederDec 12, 2011
  11. Junio C HamanoDec 12, 2011
  12. Junio C HamanoDec 12, 2011
  13. Thomas RastDec 12, 2011
  14. Jeff KingDec 12, 2011
  15. Junio C HamanoDec 12, 2011
  16. Jonathan NiederDec 12, 2011

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.