git for windows: isatty of stdin / stdout inconsistent

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

 



this seems inconsistent with posix platforms

(using cmd.exe, git 2.19.1.windows.1 though I've validated this with
other versions as well)

>cat .git\hooks\pre-commit
#!/usr/bin/env python
# note: use python3 on linux platforms for shebang
import sys
print(f'stdin: {sys.stdin.isatty()}')
print(f'stdout: {sys.stdout.isatty()}')
print(f'stderr: {sys.stderr.isatty()}')

>git commit -m foo --allow-empty
stdin: True
stdout: False
stderr: True
[master (root-commit) 9c7716f] foo

but on linux:

$ git --version
git version 2.25.1
$ git commit -m foo --allow-empty
stdin: False
stdout: True
stderr: True
[master (root-commit) eb8435a] foo

it's also weird to me that `stdin` seems flipped between the two as well

actual issue: this is breaking coloring detection in https://pre-commit.com

Anthony



[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