Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
Cc: <git@vger.kernel.org>, <peff@peff.net>
Subject: Re: [PATCH v3 2/4] imap-send: add wrapper to get server credentials if needed
Date: Thu, 24 Aug 2017 11:54:42 -0700	[thread overview]
Message-ID: <xmqqh8wwx0ct.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <d1c39912-a847-1831-60ae-18b15359092f@morey-chaisemartin.com> (Nicolas Morey-Chaisemartin's message of "Thu, 24 Aug 2017 08:08:31 +0200")

Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com> writes:

> Le 23/08/2017 à 22:13, Junio C Hamano a écrit :
>> Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com> writes:
>>
>>> Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
>>> ---
>>>  imap-send.c | 34 ++++++++++++++++++++--------------
>>>  1 file changed, 20 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/imap-send.c b/imap-send.c
>>> index 09f29ea95..448a4a0b3 100644
>>> --- a/imap-send.c
>>> +++ b/imap-send.c
>>> @@ -926,6 +926,25 @@ static int auth_cram_md5(struct imap_store *ctx, struct imap_cmd *cmd, const cha
>>>  	return 0;
>>>  }
>>>  
>>> +static void server_fill_credential(struct imap_server_conf *srvc, struct credential *cred)
>>> +{
>>> +	if (srvc->user && srvc->pass)
>>> +		return;
>>> +
>>> +	cred->protocol = xstrdup(srvc->use_ssl ? "imaps" : "imap");
>>> +	cred->host = xstrdup(srvc->host);
>>> +
>>> +	cred->username = xstrdup_or_null(srvc->user);
>>> +	cred->password = xstrdup_or_null(srvc->pass);
>>> +
>>> +	credential_fill(cred);
>>> +
>>> +	if (!srvc->user)
>>> +		srvc->user = xstrdup(cred->username);
>>> +	if (!srvc->pass)
>>> +		srvc->pass = xstrdup(cred->password);
>>> +}
>>> +
>> This looks straight-forward code movement.  The only thing that
>> makes me wonder is if this is "server".  The existing naming of the
>> variables screams at me that this is not "server" but is "service".
>
> I read srvc as server conf not service.

Oh, yeah, "server conf" is OK (I didn't think of it).

> But I can change the name if you prefer

Nah.  Please keep it.


  reply	other threads:[~2017-08-24 18:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 15:55 [PATCH v3 0/4] imap-send: Fix and enable curl by default Nicolas Morey-Chaisemartin
2017-08-22 15:56 ` [PATCH v3 1/4] imap-send: return with error if curl failed Nicolas Morey-Chaisemartin
2017-08-23 20:10   ` Junio C Hamano
2017-08-23 20:12   ` Junio C Hamano
2017-08-24  6:57     ` Nicolas Morey-Chaisemartin
2017-08-22 15:56 ` [PATCH v3 2/4] imap-send: add wrapper to get server credentials if needed Nicolas Morey-Chaisemartin
2017-08-23 20:13   ` Junio C Hamano
2017-08-24  6:08     ` Nicolas Morey-Chaisemartin
2017-08-24 18:54       ` Junio C Hamano [this message]
2017-08-22 15:56 ` [PATCH v3 3/4] imap_send: setup_curl: retreive credentials if not set in config file Nicolas Morey-Chaisemartin
2017-08-22 15:56 ` [PATCH v3 4/4] imap-send: use curl by default Nicolas Morey-Chaisemartin
2017-08-23 20:28   ` Junio C Hamano
2017-08-24  7:24     ` Nicolas Morey-Chaisemartin

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=xmqqh8wwx0ct.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=nicolas@morey-chaisemartin.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox