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

Re: Issue with git > 2.36.1 and pre-commit hook on macOS M1

From
René Scharfe <l.s.r@web.de>
Date
Dec 14, 2022, 22:23 UTC
Message-ID
<7054faf0-0f5b-e4a8-3166-bf715ed45a32@web.de>
In-Reply-To
<c07a5ac4-3da6-6fb4-4586-a83373bc05d4@o2.pl>
Am 13.12.2022 um 22:02 schrieb Piotrek:
Show 14 quoted lines
> On 12.12.2022 14:29, René Scharfe wrote:
>
>> While "docker compose" is right in that stdin is not a TTY, it
>> never was.  Redirecting the output its seems to help.  So I guess
>> it checks if stdout is connected to a terminal and then expects
>> stdin to be a TTY as well.  Try appending " | cat" to the command
>> in the pre-commit hook, which breaks the connection for stdout.
>>
>> René
>
> Just to be sure if I understand this correctly. It is probably a bug
> in docker compose expecting stdin to be a TTY, right? I'll write some
> bug report to them, maybe they will take care of this since it is
> only on MacOS and all works fine with Linux.

I don't know "docker compose" well enough to say whether it's a bug, but it seems it turns on some kind of terminal mode that needs both stdin and stdout to be connected to a TTY after only checking that one of them actually is. Why not check both?

Curious that only macOS should be affected. Is stdin of a hook script a TTY on that platform? Or can "docker compose" handle stdin not being a TTY and stdout being one there?

René
Previous: PiotrekNext: Piotrek
Message 4 of 6 in “Issue with git > 2.36.1 and pre-commit hook on macOS M1”
  1. PiotrekDec 11, 2022
  2. René ScharfeDec 12, 2022
  3. PiotrekDec 13, 2022
  4. René ScharfeDec 14, 2022
  5. PiotrekDec 17, 2022
  6. René ScharfeDec 17, 2022

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.