git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
Cc: "Bernhard Reiter" <ockham@raz.or.at>,
	"Martin Ågren" <martin.agren@gmail.com>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: [PATCH 3/4] imap_send: setup_curl: use server_conf parameter instead of the global variable
Date: Mon, 7 Aug 2017 15:50:03 -0400	[thread overview]
Message-ID: <20170807195003.clo2vmnmufmfalb6@sigill.intra.peff.net> (raw)
In-Reply-To: <71817815-4e52-4623-b226-bbb57ca08047@morey-chaisemartin.com>

On Mon, Aug 07, 2017 at 07:06:07PM +0200, Nicolas Morey-Chaisemartin wrote:

> >> -       server_fill_credential(&server);
> >> -       curl_easy_setopt(curl, CURLOPT_USERNAME, server.user);
> >> -       curl_easy_setopt(curl, CURLOPT_PASSWORD, server.pass);
> >> +       server_fill_credential(srvc);
> >> +       curl_easy_setopt(curl, CURLOPT_USERNAME, srvc->user);
> >> +       curl_easy_setopt(curl, CURLOPT_PASSWORD, srvc->pass);
> > Here you change the server_fill_credential-call that you just added.
> > Maybe do this patch earlier, perhaps even as patch 1?
> >
> > I'm snipping lots of s/server/srvc/-changes... There's a less noisy
> > way of addressing the fact that srvc is unused: dropping it. I'm not
> > saying that's a good idea, but it could be considered, then explained
> > why this approach is better. There are some other functions which
> > access "server" directly, and some which take (and use!) a "srvc".
> > Maybe make the whole file consistent?
> >
> That's why I applied it after #2. I was not sure if this one made
> sense or not. And it  can be dropped with the rest of the series still
> applying.
> I don't know what is the right approach here. Someone with more
> knowledge of why there is a mix of global variable and local can maybe
> help ?

I suspect it's just code in need of a cleanup. But let's cc the original
author of 1e16b255b (git-imap-send: use libcurl for implementation,
2014-11-09) to see if he has any comments[1].

-Peff

[1] Bernhard, the whole series is at:

      https://public-inbox.org/git/38d3ae5b-4020-63cc-edfa-0a77e42798b8@morey-chaisemartin.com/

    The general idea is to make sure the original and curl imap-send
    implementations have feature parity, make the curl version the
    default, and then hopefully eventually drop the non-curl one
    entirely.

  reply	other threads:[~2017-08-07 19:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c74c8c386f2c2d8b6cebd4addf925d0121986067.1502114584.git.nicolas@morey-chaisemartin.com>
2017-08-07 14:03 ` [PATCH 2/4] imap_send: setup_curl: prompt user for username/password if not set in config file Nicolas Morey-Chaisemartin
2017-08-07 14:04 ` [PATCH 3/4] imap_send: setup_curl: use server_conf parameter instead of the global variable Nicolas Morey-Chaisemartin
2017-08-07 16:34   ` Martin Ågren
2017-08-07 17:06     ` Nicolas Morey-Chaisemartin
2017-08-07 19:50       ` Jeff King [this message]
2017-08-07 14:04 ` [PATCH 4/4] imap-send: use curl by default Nicolas Morey-Chaisemartin
2017-08-07 16:37   ` Martin Ågren
2017-08-07 17:10     ` Nicolas Morey-Chaisemartin
2017-08-07 17:37       ` Martin Ågren
2017-08-07 20:01   ` Jeff King
2017-09-12  6:46     ` Junio C Hamano
2017-09-12  7:02       ` Junio C Hamano
2017-09-12  8: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

  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=20170807195003.clo2vmnmufmfalb6@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=martin.agren@gmail.com \
    --cc=nicolas@morey-chaisemartin.com \
    --cc=ockham@raz.or.at \
    /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).