Re: git should not use a default user.email config value
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Aug 13, 2013, 08:29 UTC
- Message-ID
- <vpqwqnqgfj9.fsf@anie.imag.fr>
- In-Reply-To
- <CAMP44s1SxSd-cM_P-JL2+skB6mDmar_QwFv9mYp5BrXUKTz61w@mail.gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 28 quoted lines
> This is how to implement that:
>
> From f1feaa05ce3772d8006078c4aeabcbd55b52d58e Mon Sep 17 00:00:00 2001
> From: Felipe Contreras 2nd <felipe.contreras+2@gmail.com>
> Date: Tue, 13 Nov 2012 07:33:12 +0100
> Subject: [PATCH] ident: don't allow implicit email addresses
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
> ident.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ident.c b/ident.c
> index 1c123e6..85fc729 100644
> --- a/ident.c
> +++ b/ident.c
> @@ -301,9 +301,9 @@ const char *fmt_ident(const char *name, const char *email,
> }
>
> if (strict && email == git_default_email.buf &&
> - strstr(email, "(none)")) {
> + !(user_ident_explicitly_given & IDENT_MAIL_GIVEN)) {
> fputs(env_hint, stderr);
> - die("unable to auto-detect email address (got '%s')", email);
> + die("no explicit email address");
> }
>
> if (want_date) {That's a first step, but something should also be done in builtin/commit.c, which currently displays a detailed warning (implicit_ident_advice) /after/ performing the commit. I think your patch would turn this warning into dead code.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/