From: Anthony Sottile <asottile@umich.edu>
To: Git Mailing List <git@vger.kernel.org>
Subject: git for windows: isatty of stdin / stdout inconsistent
Date: Fri, 12 Jun 2020 10:06:31 -0700 [thread overview]
Message-ID: <CA+dzEB=OiqaEW0CEQoChStZYcho68J9ysH_XYp0Qupbrgg1Jxg@mail.gmail.com> (raw)
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
reply other threads:[~2020-06-12 17:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+dzEB=OiqaEW0CEQoChStZYcho68J9ysH_XYp0Qupbrgg1Jxg@mail.gmail.com' \
--to=asottile@umich.edu \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).