git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Piotrek <piotrekkr@o2.pl>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>, git@vger.kernel.org
Subject: Re: Issue with git > 2.36.1 and pre-commit hook on macOS M1
Date: Sat, 17 Dec 2022 09:34:27 +0100	[thread overview]
Message-ID: <18ad9fae-2afd-4315-c65f-d9bb92fa30fe@web.de> (raw)
In-Reply-To: <a1fb9d92-5161-5ba0-54f2-a03cbc45f399@o2.pl>

Am 17.12.22 um 08:50 schrieb Piotrek:
> On 14.12.2022 23:23, René Scharfe wrote:
>
>> Curious that only macOS should be affected.  Is stdin of a hook script a
>> TTY on that platform?  Or can "docker compose" handle stdin not being a
>> TTY and stdout being one there?

> Well, seems like I somehow tested this wrong. Tried it again from
> scratch and on linux I also get this error.

Ah, OK.

> Docker compose CLI options page is a little confusing because of
> these:
>
>>--interactive , -i  true  Keep STDIN open even if not attached.
>>--no-TTY , -T          true  Disable pseudo-TTY allocation (default: auto-detected).
>>--tty , -t          true  Allocate a pseudo-TTY.
>
> Second column with `true` values is titled `Default`, whatever it means.
> So `--tty` and `--no-TTY` is set by default? Anyway, seems like it is
> checking if at least one of stdout, stding, stderr is a tty and then
> tries to allocate a tty to all.
>
> You can check docs here
> https://docs.docker.com/engine/reference/commandline/compose_run/#options
Yeah, having the last two both on by default seems impossible.  Perhaps
the text in the parenthesis means that "default" is actually to detect
TTYs automatically?  In any case the help text could be clearer.

> As a final solution I used makefile "magic" with `ifeq` and shell command like this:
>
>     $(shell test -t 0)
>     ifeq ($(.SHELLSTATUS), 1)
>     ALLOCATE_TTY = --no-TTY
>     endif
>
>     docker compose run $(ALLOCATE_TTY) --rm --entrypoint "" app /code/test.sh

OK.  Would be nice if "docker compose" could handle that case
automatically, though, wouldn't it? :)

> Maybe I'll just write to to them to clarify documentation on how
> those TTY options actually works by default.
Good idea.

René

      reply	other threads:[~2022-12-17  8:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-11 21:11 Issue with git > 2.36.1 and pre-commit hook on macOS M1 Piotrek
2022-12-12 13:29 ` René Scharfe
2022-12-13 21:02   ` Piotrek
2022-12-14 22:23     ` René Scharfe
2022-12-17  7:50       ` Piotrek
2022-12-17  8:34         ` René Scharfe [this message]

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=18ad9fae-2afd-4315-c65f-d9bb92fa30fe@web.de \
    --to=l.s.r@web.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=piotrekkr@o2.pl \
    /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).