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

Re: [PATCH/RFC 7/7] t7006-pager: if stdout is not a terminal, make a new one

From
Jeff King <peff@peff.net>
Date
Feb 19, 2010, 08:08 UTC
Message-ID
<20100219080819.GA13691@coredump.intra.peff.net>
In-Reply-To
<20100219072331.GG29916@progeny.tock>
On Fri, Feb 19, 2010 at 01:23:31AM -0600, Jonathan Nieder wrote:
Show 15 quoted lines
> Test t7006-pager skips most of its tests except when running with
> --verbose, for lack of a terminal to use.  Thus many of the tests
> would not get much coverage, since whole testsuite runs with --verbose
> are rare.  Redirecting output to /dev/tty would be problematic because
> (1) there really could be no controlling terminal and (2) test
> breakage might manifest itself by the producing extraneous output.
> Luckily, there is a way around this: Unix98-style pseudo-terminals
> allow us to create a fake terminal on the fly and capture its output.
> 
> Do so.  The new test-terminal command to accomplish this uses
> posix_openpt (from SuSv3) to create a terminal because that is good
> enough on Linux.  I would like some feedback on what platforms are
> missing that function and thus what alternate interfaces are worth
> supporting.  The perl IO::Tty module could take care of this for us,
> but I do not think it is worth the extra dependency.

Solaris 8 and 9 seem to be lacking it. Solaris 10 does have it. AIX 5.2 and 6.1 both have it.

So it would mean some platforms couldn't run all tests. That is probably good enough, given that most of our terminal-related bugs have not been platform-specific problems.

Still, it seems like just wrapping isatty would be simpler. I guess you are opposed to carrying around test-specific code in the main git binary?

-Peff
Previous: Jonathan NiederNext: Jonathan Nieder
Message 16 of 26 in “Re: 'git svn log' no longer uses the pager”
  1. 0/7 Re: 'git svn log' no longer uses the pagerJonathan Nieder, Feb 19, 2010
  2. 1/7 Fix 'git var' usage synopsisJonathan Nieder, Feb 19, 2010
  3. 2/7 Make 'git var GIT_PAGER' always print the configured pagerJonathan Nieder, Feb 19, 2010
  4. 3/7 git.1: Clarify the behavior of the --paginate optionJonathan Nieder, Feb 19, 2010
  5. 4/7 git svn: Fix launching of pagerJonathan Nieder, Feb 19, 2010
  6. 5/7 am: Fix launching of pagerJonathan Nieder, Feb 19, 2010
  7. 6/7 tests: Add tests for automatic use of pagerJonathan Nieder, Feb 19, 2010
  8. Junio C HamanoFeb 20, 2010
  9. 6/7 tests: Add tests for automatic use of pagerJonathan Nieder, Feb 21, 2010
  10. 7/7 t7006-pager: if stdout is not a terminal, make a new oneJonathan Nieder, Feb 21, 2010
  11. Jeff KingFeb 21, 2010
  12. Johannes SixtFeb 22, 2010
  13. 8/7 tests: Fix race condition in t7006-pagerJonathan Nieder, Feb 22, 2010
  14. Jonathan NiederFeb 22, 2010
  15. 7/7 t7006-pager: if stdout is not a terminal, make a new oneJonathan Nieder, Feb 19, 2010
  16. Jeff KingFeb 19, 2010
  17. Jonathan NiederFeb 19, 2010
  18. Jeff KingFeb 19, 2010
  19. Brandon CaseyFeb 19, 2010
  20. Brandon CaseyFeb 20, 2010
  21. Jonathan NiederFeb 20, 2010
  22. Brandon CaseyFeb 20, 2010
  23. 7/7 t7006-pager: if stdout is not a terminal, make a new oneJonathan Nieder, Feb 20, 2010
  24. Junio C HamanoFeb 20, 2010
  25. 7/7 t7006-pager: if stdout is not a terminal, make a new oneJonathan Nieder, Feb 20, 2010
  26. Simplify test-terminal.perlJonathan Nieder, Feb 20, 2010

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.