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

Re: [PATCH] git-send-email: die if sendmail.* config is set

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2020, 18:02 UTC
Message-ID
<xmqqpn8sbt0w.fsf@gitster.c.googlers.com>
In-Reply-To
<20200718132311.27248-1-sir@cmpwn.com>
Drew DeVault <sir@cmpwn.com> writes:
> I've seen several people mis-configure git send-email on their first
> attempt because they set the sendmail.* config options - not
> sendemail.*. This patch detects this mistake and bails out with a
> friendly warning.
It is not very friendly thing to do, though.

It just closes the door for anybody to add something that works independent from "git send-email", to which "sendmail.*" variables may be appropriate knob to use.

Demoting the "die" to "warn" is OK, and limiting the check to variables that actually has corresponding and likely-misspelt "sendemail.*" counterparts would be even better, but "you are not allowed to have any 'sendmail.*' variables, ever" is way too much, I am afraid.

Show 19 quoted lines
> Signed-off-by: Drew DeVault <sir@cmpwn.com>
> ---
>  git-send-email.perl |  6 ++++++
>  perl/Git.pm         | 26 ++++++++++++++++++++++++++
>  2 files changed, 32 insertions(+)
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 36c47bae1d..8e42ba00c1 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -478,6 +478,12 @@ sub read_config {
>      usage();
>  }
>  
> +if ((scalar Git::config_regexp("sendmail.*")) != 0) {
> +	die __("fatal: found configuration options for 'sendmail'\n" .
> +		"git-send-email is configured with the sendemail.* options - note the 'e'.\n" .
> +		"Assuming this is a mistake and bailing out.\n");
> +}
Previous: Drew DeVaultNext: Drew DeVault
Message 2 of 4 in “git-send-email: die if sendmail.* config is set”
  1. git-send-email: die if sendmail.* config is setDrew DeVault, Jul 18, 2020
  2. Junio C HamanoJul 18, 2020
  3. Drew DeVaultJul 18, 2020
  4. Junio C HamanoJul 18, 2020

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.