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

Re: What's cooking in git.git (Dec 2016, #02; Mon, 12)

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 13, 2016, 16:09 UTC
Message-ID
<xmqqmvfz6cae.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<alpine.DEB.2.20.1612131638290.23160@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 17 quoted lines
> Hi Junio,
>
> On Mon, 12 Dec 2016, Junio C Hamano wrote:
>
>> * js/mingw-isatty (2016-12-11) 1 commit
>>   (merged to 'next' on 2016-12-12 at 60c1da6676)
>>  + mingw: intercept isatty() to handle /dev/null as Git expects it
>> 
>>  We often decide if a session is interactive by checking if the
>>  standard I/O streams are connected to a TTY, but isatty() emulation
>>  on Windows incorrectly returned true if it is used on NUL (i.e. an
>>  equivalent to /dev/null). This has been fixed.
>
> I'd like to suggest a reword: we did not use an isatty() emulation, but
> Windows' own _isatty() function that simply has different semantics than
> what Git expected. *Now* we have an isatty() emulation that wraps
> _isatty() and emulates the behavior expected by Git.
Thanks for a comment.
One of the things that the new code does with the fix is this:

+/* In this file, we actually want to use Windows' own isatty(). */ +#undef isatty +

which undoes "#define isatty winansi_isatty" that other code uses, so that the implementation of winansi_isatty() can say isatty() and get what people usually get when they say "isatty()" on Windows.

Before or after that patch, there is no "#define isatty _isatty" in our codebase. I take all of the above to mean that Windows does give us isatty() function (not a macro--as otherwise it won't become available to us again by "#undef isatty"), that in turn internally calls what it calls _isatty() that says true for NUL?

Following the above reasoning, I meant "whatever you get when you write isatty() on Windows" by "isatty() emulation on Windows" in the paragraph you are commenting on. I didn't say "what was written by Git for Windows folks to emulate isatty()" or "what was given by MS development tools", as that distinction is immaterial and does not change the value of the fix.

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 of 10 in “What's cooking in git.git (Dec 2016, #02; Mon, 12)”
  1. Junio C HamanoDec 12, 2016
  2. Johannes SchindelinDec 13, 2016
  3. Junio C HamanoDec 13, 2016
  4. Johannes SchindelinDec 13, 2016
  5. Junio C HamanoDec 13, 2016
  6. Johannes SchindelinDec 19, 2016
  7. Junio C HamanoDec 19, 2016
  8. Johannes SchindelinDec 13, 2016
  9. Junio C HamanoDec 13, 2016
  10. Brandon WilliamsDec 13, 2016

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.