git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git for windows: isatty of stdin / stdout inconsistent
@ 2020-06-12 17:06 Anthony Sottile
  0 siblings, 0 replies; only message in thread
From: Anthony Sottile @ 2020-06-12 17:06 UTC (permalink / raw)
  To: Git Mailing List

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-12 17:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 17:06 git for windows: isatty of stdin / stdout inconsistent Anthony Sottile

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).