From: Jeff King <peff@peff.net>
To: Thomas Koutcher via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Thomas Koutcher <thomas.koutcher@online.fr>
Subject: Re: [PATCH] credential: load default config
Date: Thu, 15 Oct 2020 21:04:23 -0400 [thread overview]
Message-ID: <20201016010423.GD2932796@coredump.intra.peff.net> (raw)
In-Reply-To: <pull.881.git.git.1602799160623.gitgitgadget@gmail.com>
On Thu, Oct 15, 2020 at 09:59:20PM +0000, Thomas Koutcher via GitGitGadget wrote:
> Make `git credential fill` honour the core.askPass variable.
Thanks, I agree this make sense to do.
> builtin/credential.c | 3 +++
> 1 file changed, 3 insertions(+)
Perhaps it's worth squashing in this test?
diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh
index bc2d74098f..a18f8a473b 100755
--- a/t/t0300-credentials.sh
+++ b/t/t0300-credentials.sh
@@ -265,6 +265,32 @@ test_expect_success 'internal getpass does not ask for known username' '
EOF
'
+test_expect_success 'git-credential respects core.askPass' '
+ write_script alternate-askpass <<-\EOF &&
+ echo >&2 "alternate askpass invoked"
+ echo alternate-value
+ EOF
+ test_config core.askpass "$PWD/alternate-askpass" &&
+ (
+ # unset GIT_ASKPASS set by lib-credential.sh which would
+ # override our config, but do so in a subshell so that we do
+ # not interfere with other tests
+ sane_unset GIT_ASKPASS &&
+ check fill <<-\EOF
+ protocol=http
+ host=example.com
+ --
+ protocol=http
+ host=example.com
+ username=alternate-value
+ password=alternate-value
+ --
+ alternate askpass invoked
+ alternate askpass invoked
+ EOF
+ )
+'
+
HELPER="!f() {
cat >/dev/null
echo username=foo
next prev parent reply other threads:[~2020-10-16 1:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-15 21:59 [PATCH] credential: load default config Thomas Koutcher via GitGitGadget
2020-10-16 1:04 ` Jeff King [this message]
2020-10-16 20:39 ` Thomas Koutcher
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=20201016010423.GD2932796@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=thomas.koutcher@online.fr \
/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).