{"thread":{"id":"53667","subject":"git for windows: isatty of stdin / stdout inconsistent","startedAt":"2020-06-12T17:06:48Z","lastAt":"2020-06-12T17:06:48Z","messageCount":1,"participants":["Anthony Sottile"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"399611","messageId":"CA+dzEB=OiqaEW0CEQoChStZYcho68J9ysH_XYp0Qupbrgg1Jxg@mail.gmail.com","threadId":"53667","inReplyTo":null,"subject":"git for windows: isatty of stdin / stdout inconsistent","fromName":"Anthony Sottile","fromEmail":"asottile@umich.edu","sentAt":"2020-06-12T17:06:31Z","receivedAt":"2020-06-12T17:06:48Z","isPatch":false,"sender":{"key":"asottile@umich.edu","avatar":"https://avatars.githubusercontent.com/u/1810591?v=4"},"body":"this seems inconsistent with posix platforms\n\n(using cmd.exe, git 2.19.1.windows.1 though I've validated this with\nother versions as well)\n\n>cat .git\\hooks\\pre-commit\n#!/usr/bin/env python\n# note: use python3 on linux platforms for shebang\nimport sys\nprint(f'stdin: {sys.stdin.isatty()}')\nprint(f'stdout: {sys.stdout.isatty()}')\nprint(f'stderr: {sys.stderr.isatty()}')\n\n>git commit -m foo --allow-empty\nstdin: True\nstdout: False\nstderr: True\n[master (root-commit) 9c7716f] foo\n\nbut on linux:\n\n$ git --version\ngit version 2.25.1\n$ git commit -m foo --allow-empty\nstdin: False\nstdout: True\nstderr: True\n[master (root-commit) eb8435a] foo\n\nit's also weird to me that `stdin` seems flipped between the two as well\n\nactual issue: this is breaking coloring detection in https://pre-commit.com\n\nAnthony\n"}]}