Re: [PATCH] imap-send: parse default git config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 11/25/20 9:31 AM, Junio C Hamano wrote:
Nicolas Morey-Chaisemartin <nmoreychaisemartin@xxxxxxxx> writes:

git imap-send does not parse the default git config settings and thus ignore
core.askpass value.
Fix it by calling git_config(git_default_config)

Reported-by: Philippe Blain <levraiphilippeblain@xxxxxxxxx>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@xxxxxxxx>
---
  imap-send.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/imap-send.c b/imap-send.c
index 5764dd812ca7..790780b76da2 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -1367,6 +1367,7 @@ static void git_imap_config(void)
  	git_config_get_int("imap.port", &server.port);
  	git_config_get_string("imap.tunnel", &server.tunnel);
  	git_config_get_string("imap.authmethod", &server.auth_method);
+	git_config(git_default_config, NULL);

There are two styles of parsing configuration variables to get
values.  The way imap-send.c works is to grab individual values by
calling git_config_get_*() functions.  The other is to give a
callback function to git_config() to iterate over all configuration
variables and pick the relevant ones.


OK. I thought it wouldn't be THAT easy :)


Of course you could also unify in the other direction and instead of
running git_config(git_defauilt_config, NULL), pick the exact
variables you care about (did you say askpass???).

The only one we care about for this specific case if core.askpass as user gets prompted to authenticate on his IMAP server.
So picking just this one would be simpler. However isn't the other way around cleaner if we happen to depend on another "generic/core" setting ?

Nicolas




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux