All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Pohorelsky <opohorel@redhat.com>
To: git@vger.kernel.org
Cc: peff@peff.net
Subject: GIT_TERMINAL_PROMPT environment variable isn't honored properly
Date: Tue, 29 Jun 2021 15:46:44 +0200	[thread overview]
Message-ID: <CA+B51BHBoDn+xFXOXWe0SvRzzuPo+YYj63f0dyafJELbBTgGbw@mail.gmail.com> (raw)

Hi, we've run into an issue when running git as part of an automated system.

When you set the GIT_TERMINAL_PROMPT environment variable as 0 you
expect git to die instead of trying to issue a prompt on the terminal.


$ GIT_TERMINAL_PROMPT=0
$ echo $GIT_TERMINAL_PROMPT
0
$ git clone https://github.com/some/non-existent-repo
Cloning into 'non-existent-repo'...
Username for 'https://github.com':


You get expected behaviour only when you set the GIT_TERMINAL_PROMPT
variable just before you run git clone.


$ GIT_TERMINAL_PROMPT=0 git clone https://github.com/some/non-existent-repo
Cloning into 'non-existent-repo'...
fatal: could not read Username for 'https://github.com': terminal
prompts disabled


I've tested this issue on Fedora 34 with git-2.32.0 and Ubuntu 20.10
with git-2.27.0 and I successfully reproduced this bug.
Sadly I didn't manage to figure out why this is happening, that's why
I'm only filling a bug.

This variable was introduced in commit
"e652c0eb5d772076f92245c7e076bf6aaf6af223" by Jeff King, that's why
I'm adding him to CC.


Best regards,
Ondřej Pohořelský


             reply	other threads:[~2021-06-29 13:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29 13:46 Ondrej Pohorelsky [this message]
2021-06-29 13:52 ` GIT_TERMINAL_PROMPT environment variable isn't honored properly brian m. carlson
2021-06-29 14:37   ` Ondrej Pohorelsky

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+B51BHBoDn+xFXOXWe0SvRzzuPo+YYj63f0dyafJELbBTgGbw@mail.gmail.com \
    --to=opohorel@redhat.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.