Subject: Re: [bug#66618] [PATCH] etc: gitconfig: Remove the default email address to avoid mistakes.

From: Simon Tournier <[email-masked]>
Date: Fri, 20 Oct 2023 16:06:59 +0200

Hi Maxim,

On Thu, 19 Oct 2023 at 21:54, Maxim Cournoyer <[email-masked]> wrote:

> One could argue it's also a misleading documentation.  It should say if
> a 'to' address is not specified *or* configured.  

Well, personally I prefer: « Explicit is better than implicit. » and
« Errors should never pass silently.  Unless explicitly silenced. ».

Here, the default

     [sendemail]
            to = [email-masked]

makes something implicit – which is not necessary bad – but it hides
potential errors – which is not good.

IIUC, Clément use-case is the following:

  git send-email --reply-to=[email-masked] v2-0001-blabla.patch

which is an incorrect use of git-send-email.

Because of the default value ’sendemail.to’ from .git/config, the patch
v2-0001-blabla.patch is sent to [email-masked].  At best, Clément
spots that and merges the new created issue with #12345.  At worse, it
falls into the crack.  In all cases, it is burden.

Without the default value, the mistake is directly pointed out;
git-send-email asks the value for To: since no one is provided.

With the default value, it does not teach how to correctly use
git-send-email and worse it hides the incorrect usage.

>                                                   What would you have
> typed interactively if prompted; [email-masked]? :-)

Yes, but it teaches me that I must provide the To: field.

Well, I do not see which difficulty the default value solves.  However,
I see which difficulty it introduces. :-)

> OK!  I'll leave this opened for a bit longer to allow for others to tip
> in, after which I'll do so.

Somehow, I think Clément’s suggestion seems more POLA.  But I do not
mind much since I always use ’--to=’. ;-)

Cheers,
simon