Skip to content

Commit d5cc2de

Browse files
hanwenJunio C Hamano
authored andcommitted
ident.c: Trim hint printed when gecos is empty.
Also remove asterisks for readability, and suggest use of git-config for easy cut & pasting. Signed-off-by: Han-Wen Nienhuys <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 67ffa11 commit d5cc2de

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

ident.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,17 @@ static int copy(char *buf, int size, int offset, const char *src)
158158
static const char au_env[] = "GIT_AUTHOR_NAME";
159159
static const char co_env[] = "GIT_COMMITTER_NAME";
160160
static const char *env_hint =
161-
"\n*** Environment problem:\n"
161+
"\n"
162162
"*** Your name cannot be determined from your system services (gecos).\n"
163-
"*** You would need to set %s and %s\n"
164-
"*** environment variables; otherwise you won't be able to perform\n"
165-
"*** certain operations because of \"empty ident\" errors.\n"
166-
"*** Alternatively, you can use user.name configuration variable.\n\n";
163+
"\n"
164+
"Run\n"
165+
"\n"
166+
" git repo-config user.email \"[email protected]\"\n"
167+
" git repo-config user.name \"Your Name\"\n"
168+
"\n"
169+
"To set the identity in this repository.\n"
170+
"Add --global to set your account\'s default\n"
171+
"\n";
167172

168173
static const char *get_ident(const char *name, const char *email,
169174
const char *date_str, int error_on_no_name)

0 commit comments

Comments
 (0)