git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] imap-send: use server conf argument in setup_curl()

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 5, 2023, 17:23 UTC
Message-ID
<xmqq35222rx1.fsf@gitster.g>
In-Reply-To
<20230703063330.GA3524421@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Our caller passes in an imap_server_conf struct, but we ignore it
> totally, and instead read the config directly from the global "server"
> variable. This works OK, since our sole caller will pass in that same
> global variable.
This obviously is the right thing to do.

A much inferiour alternative would be to drop the srvc parameter to the callee and that will make it clear that we are only working on the singleton 'imap_server_conf' all the time (which is not entirely incorrect), but I do not think there is no point in making any large change to this program at this point in either direction.

> But the intent seems to have been to use the passed-in
> variable, as otherwise it has no purpose (and many other functions use
> the same pattern).
Yup.  Thanks.
Previous: Jeff KingNext: Jeff King
Message 3 of 7 in “imap-send: some -Wunused-parameter cleanups”
  1. 0/3 imap-send: some -Wunused-parameter cleanupsJeff King, Jul 3, 2023
  2. 1/3 imap-send: use server conf argument in setup_curl()Jeff King, Jul 3, 2023
  3. Junio C HamanoJul 5, 2023
  4. 2/3 imap-send: drop unused parameter from imap_cmd_cb callbackJeff King, Jul 3, 2023
  5. Junio C HamanoJul 5, 2023
  6. 3/3 imap-send: drop unused fields from imap_cmd_cbJeff King, Jul 3, 2023
  7. Junio C HamanoJul 5, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.