|
|
@ -345,18 +345,32 @@ person_only: |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static const char *env_hint = |
|
|
|
|
|
|
|
N_("\n" |
|
|
|
static void ident_env_hint(enum want_ident whose_ident) |
|
|
|
"*** Please tell me who you are.\n" |
|
|
|
{ |
|
|
|
"\n" |
|
|
|
switch (whose_ident) { |
|
|
|
"Run\n" |
|
|
|
case WANT_AUTHOR_IDENT: |
|
|
|
"\n" |
|
|
|
fputs(_("Author identity unknown\n"), stderr); |
|
|
|
" git config --global user.email \"you@example.com\"\n" |
|
|
|
break; |
|
|
|
" git config --global user.name \"Your Name\"\n" |
|
|
|
case WANT_COMMITTER_IDENT: |
|
|
|
"\n" |
|
|
|
fputs(_("Committer identity unknown\n"), stderr); |
|
|
|
"to set your account\'s default identity.\n" |
|
|
|
break; |
|
|
|
"Omit --global to set the identity only in this repository.\n" |
|
|
|
default: |
|
|
|
"\n"); |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fputs(_("\n" |
|
|
|
|
|
|
|
"*** Please tell me who you are.\n" |
|
|
|
|
|
|
|
"\n" |
|
|
|
|
|
|
|
"Run\n" |
|
|
|
|
|
|
|
"\n" |
|
|
|
|
|
|
|
" git config --global user.email \"you@example.com\"\n" |
|
|
|
|
|
|
|
" git config --global user.name \"Your Name\"\n" |
|
|
|
|
|
|
|
"\n" |
|
|
|
|
|
|
|
"to set your account\'s default identity.\n" |
|
|
|
|
|
|
|
"Omit --global to set the identity only in this repository.\n" |
|
|
|
|
|
|
|
"\n"), stderr); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const char *fmt_ident(const char *name, const char *email, |
|
|
|
const char *fmt_ident(const char *name, const char *email, |
|
|
|
enum want_ident whose_ident, const char *date_str, int flag) |
|
|
|
enum want_ident whose_ident, const char *date_str, int flag) |
|
|
@ -375,12 +389,12 @@ const char *fmt_ident(const char *name, const char *email, |
|
|
|
if (!email) { |
|
|
|
if (!email) { |
|
|
|
if (strict && ident_use_config_only |
|
|
|
if (strict && ident_use_config_only |
|
|
|
&& !(ident_config_given & IDENT_MAIL_GIVEN)) { |
|
|
|
&& !(ident_config_given & IDENT_MAIL_GIVEN)) { |
|
|
|
fputs(_(env_hint), stderr); |
|
|
|
ident_env_hint(whose_ident); |
|
|
|
die(_("no email was given and auto-detection is disabled")); |
|
|
|
die(_("no email was given and auto-detection is disabled")); |
|
|
|
} |
|
|
|
} |
|
|
|
email = ident_default_email(); |
|
|
|
email = ident_default_email(); |
|
|
|
if (strict && default_email_is_bogus) { |
|
|
|
if (strict && default_email_is_bogus) { |
|
|
|
fputs(_(env_hint), stderr); |
|
|
|
ident_env_hint(whose_ident); |
|
|
|
die(_("unable to auto-detect email address (got '%s')"), email); |
|
|
|
die(_("unable to auto-detect email address (got '%s')"), email); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -397,13 +411,13 @@ const char *fmt_ident(const char *name, const char *email, |
|
|
|
if (!name) { |
|
|
|
if (!name) { |
|
|
|
if (strict && ident_use_config_only |
|
|
|
if (strict && ident_use_config_only |
|
|
|
&& !(ident_config_given & IDENT_NAME_GIVEN)) { |
|
|
|
&& !(ident_config_given & IDENT_NAME_GIVEN)) { |
|
|
|
fputs(_(env_hint), stderr); |
|
|
|
ident_env_hint(whose_ident); |
|
|
|
die(_("no name was given and auto-detection is disabled")); |
|
|
|
die(_("no name was given and auto-detection is disabled")); |
|
|
|
} |
|
|
|
} |
|
|
|
name = ident_default_name(); |
|
|
|
name = ident_default_name(); |
|
|
|
using_default = 1; |
|
|
|
using_default = 1; |
|
|
|
if (strict && default_name_is_bogus) { |
|
|
|
if (strict && default_name_is_bogus) { |
|
|
|
fputs(_(env_hint), stderr); |
|
|
|
ident_env_hint(whose_ident); |
|
|
|
die(_("unable to auto-detect name (got '%s')"), name); |
|
|
|
die(_("unable to auto-detect name (got '%s')"), name); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -411,7 +425,7 @@ const char *fmt_ident(const char *name, const char *email, |
|
|
|
struct passwd *pw; |
|
|
|
struct passwd *pw; |
|
|
|
if (strict) { |
|
|
|
if (strict) { |
|
|
|
if (using_default) |
|
|
|
if (using_default) |
|
|
|
fputs(_(env_hint), stderr); |
|
|
|
ident_env_hint(whose_ident); |
|
|
|
die(_("empty ident name (for <%s>) not allowed"), email); |
|
|
|
die(_("empty ident name (for <%s>) not allowed"), email); |
|
|
|
} |
|
|
|
} |
|
|
|
pw = xgetpwuid_self(NULL); |
|
|
|
pw = xgetpwuid_self(NULL); |
|
|
|