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

Re: [PATCH v2] imap-send: Use parse options API to determine verbosity

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 6, 2014, 00:01 UTC
Message-ID
<xmqqbnoli4e0.fsf@gitster.dls.corp.google.com>
In-Reply-To
<545AAA60.3040207@raz.or.at>
Bernhard Reiter <ockham@raz.or.at> writes:
Show 6 quoted lines
> Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
> ---
> In reply to <xmqqk339ibal.fsf@gitster.dls.corp.google.com>.
>
> Thanks for bearing with me. I should've given the corresponding verbosity
> values more thought myself in the first place.

The original defined and even used these two variables, but as far as I can tell they were always set to 0 and nobody modified them. Hence, we would be OK as long as the end result will behave the same as before without any -v/-q from the command line ;-)

Thanks.  This version looks more sensible.
Show 8 quoted lines
> -	if (argc != 1)
> -		usage(imap_send_usage);
> -
>  	setup_git_directory_gently(&nongit_ok);
>  	git_imap_config();
>  
> +	argc = parse_options(argc, (const char **)argv, "", imap_send_options, imap_send_usage, 0);
> +

... except we might want to check argc here and say something about missing or excess parameters, which was lost in the change in this hunk. I think (without giving it a real thought, though ;-) you would expect that nothing remains on the command line after parse_options() has done its thing, no?

>  	if (!server.port)
>  		server.port = server.use_ssl ? 993 : 143;
Previous: Bernhard ReiterNext: Junio C Hamano
Message 2 of 3 in “imap-send: Use parse options API to determine verbosity”
  1. imap-send: Use parse options API to determine verbosityBernhard Reiter, Nov 5, 2014
  2. Junio C HamanoNov 6, 2014
  3. Junio C HamanoNov 6, 2014

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.