{"thread":{"id":"54435","subject":"[PATCH] credential: load default config","startedAt":"2020-10-15T21:59:25Z","lastAt":"2020-10-16T20:40:38Z","messageCount":3,"participants":["Thomas Koutcher via GitGitGadget","Jeff King","Thomas Koutcher"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"407686","messageId":"pull.881.git.git.1602799160623.gitgitgadget@gmail.com","threadId":"54435","inReplyTo":null,"subject":"[PATCH] credential: load default config","fromName":"Thomas Koutcher via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-10-15T21:59:20Z","receivedAt":"2020-10-15T21:59:25Z","isPatch":true,"sender":{"key":"thomas.koutcher@online.fr","avatar":"https://avatars.githubusercontent.com/u/11375970?v=4"},"body":"From: Thomas Koutcher <thomas.koutcher@online.fr>\n\nMake `git credential fill` honour the core.askPass variable.\n\nSigned-off-by: Thomas Koutcher <thomas.koutcher@online.fr>\n---\n    credential: load default config\n    \n    Make git credential fill honour the core.askPass variable.\n    \n    Signed-off-by: Thomas Koutcher thomas.koutcher@online.fr\n    [thomas.koutcher@online.fr]\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-881%2Fkoutcher%2Fmaint-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-881/koutcher/maint-v1\nPull-Request: https://github.com/git/git/pull/881\n\n builtin/credential.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/builtin/credential.c b/builtin/credential.c\nindex 879acfbcda..d75dcdc64a 100644\n--- a/builtin/credential.c\n+++ b/builtin/credential.c\n@@ -1,6 +1,7 @@\n #include \"git-compat-util.h\"\n #include \"credential.h\"\n #include \"builtin.h\"\n+#include \"config.h\"\n \n static const char usage_msg[] =\n \t\"git credential [fill|approve|reject]\";\n@@ -10,6 +11,8 @@ int cmd_credential(int argc, const char **argv, const char *prefix)\n \tconst char *op;\n \tstruct credential c = CREDENTIAL_INIT;\n \n+\tgit_config(git_default_config, NULL);\n+\n \tif (argc != 2 || !strcmp(argv[1], \"-h\"))\n \t\tusage(usage_msg);\n \top = argv[1];\n\nbase-commit: 47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc\n-- \ngitgitgadget\n"},{"id":"407696","messageId":"20201016010423.GD2932796@coredump.intra.peff.net","threadId":"54435","inReplyTo":"pull.881.git.git.1602799160623.gitgitgadget@gmail.com","subject":"Re: [PATCH] credential: load default config","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-10-16T01:04:23Z","receivedAt":"2020-10-16T01:08:38Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Oct 15, 2020 at 09:59:20PM +0000, Thomas Koutcher via GitGitGadget wrote:\n\n> Make `git credential fill` honour the core.askPass variable.\n\nThanks, I agree this make sense to do.\n\n>  builtin/credential.c | 3 +++\n>  1 file changed, 3 insertions(+)\n\nPerhaps it's worth squashing in this test?\n\ndiff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh\nindex bc2d74098f..a18f8a473b 100755\n--- a/t/t0300-credentials.sh\n+++ b/t/t0300-credentials.sh\n@@ -265,6 +265,32 @@ test_expect_success 'internal getpass does not ask for known username' '\n \tEOF\n '\n \n+test_expect_success 'git-credential respects core.askPass' '\n+\twrite_script alternate-askpass <<-\\EOF &&\n+\techo >&2 \"alternate askpass invoked\"\n+\techo alternate-value\n+\tEOF\n+\ttest_config core.askpass \"$PWD/alternate-askpass\" &&\n+\t(\n+\t\t# unset GIT_ASKPASS set by lib-credential.sh which would\n+\t\t# override our config, but do so in a subshell so that we do\n+\t\t# not interfere with other tests\n+\t\tsane_unset GIT_ASKPASS &&\n+\t\tcheck fill <<-\\EOF\n+\t\tprotocol=http\n+\t\thost=example.com\n+\t\t--\n+\t\tprotocol=http\n+\t\thost=example.com\n+\t\tusername=alternate-value\n+\t\tpassword=alternate-value\n+\t\t--\n+\t\talternate askpass invoked\n+\t\talternate askpass invoked\n+\t\tEOF\n+\t)\n+'\n+\n HELPER=\"!f() {\n \t\tcat >/dev/null\n \t\techo username=foo\n"},{"id":"407756","messageId":"9410cdd8-f249-6da3-dd8d-4c8b4ea0c805@online.fr","threadId":"54435","inReplyTo":"20201016010423.GD2932796@coredump.intra.peff.net","subject":"Re: [PATCH] credential: load default config","fromName":"Thomas Koutcher","fromEmail":"thomas.koutcher@online.fr","sentAt":"2020-10-16T20:39:57Z","receivedAt":"2020-10-16T20:40:38Z","isPatch":true,"sender":{"key":"thomas.koutcher@online.fr","avatar":"https://avatars.githubusercontent.com/u/11375970?v=4"},"body":"Le 16/10/2020 à 03:04, Jeff King a écrit :\n\n> Perhaps it's worth squashing in this test?\n\nDefinitely, thanks for adding the test, Peff !\n\n\n"}]}