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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 11.12.22 um 22:11 schrieb Piotrek:
> Hello.
>
> On MacOS 12.6.1 with M1 chip, git >=2.37.0 (installed by homebrew)
> and pre-commit hook that is calling *make* target, that is calling
> *docker compose run* command, we get error:
>
> the input device is not a TTY
>
> All works file with homebrew git version 2.36.1

Bisects to a082345372 (hook API: fix v2.36.0 regression: hooks should be
connected to a TTY, 2022-06-07).

Adding "for fd in 0 1 2; do test -t $fd; printf %d $?; done; echo" to
the shell script .git/hook/pre-commit yields 100 since a082345372, i.e.
fd 1 (stdout) and fd 2 (stderr) are associated with a terminal, while
fd 0 (stdin) is not.  Before we got 111, i.e. none of the standard file
descriptors were associated with a terminal.

v2.37.0 includes a082345372.  v2.35.0 gives 100 as well, as expected, so
older versions of Git should have "docker compose" complain as well.

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é




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux