From: Junio C Hamano <gitster@pobox.com>
To: Drew DeVault <sir@cmpwn.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-send-email: die if sendmail.* config is set
Date: Sat, 18 Jul 2020 11:02:55 -0700 [thread overview]
Message-ID: <xmqqpn8sbt0w.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20200718132311.27248-1-sir@cmpwn.com> (Drew DeVault's message of "Sat, 18 Jul 2020 09:23:11 -0400")
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.
> 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");
> +}
next prev parent reply other threads:[~2020-07-18 18:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-18 13:23 [PATCH] git-send-email: die if sendmail.* config is set Drew DeVault
2020-07-18 18:02 ` Junio C Hamano [this message]
2020-07-18 18:25 ` Drew DeVault
2020-07-18 20:10 ` Junio C Hamano
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=xmqqpn8sbt0w.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=sir@cmpwn.com \
/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