Skip to contentSkip to conversation

config --global --edit: generate correct .gitconfig template

PATCH In review Pete Harlan 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 config --global --edit: generate correct .gitconfig template

When the user asks to edit an empty .gitconfig file, we learned to generate a default version in 9830534e (config --global --edit: create a template file if needed, 2014-07-25), but the generated config mistakenly set core.user and core.email instead of user.name and user.email. Fix this.

---

I ran up against this yesterday and it is easy enough to fix, but I don't have time right now to write tests for it.

 builtin/config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
builtin/config.c +2 -2
index d32c532..bfd3016 100644
@@ -455,9 +455,9 @@ static char *default_user_config(void)
 	struct strbuf buf = STRBUF_INIT;
 	strbuf_addf(&buf,
 		    _("# This is Git's per-user configuration file.\n"
-		      "[core]\n"
+		      "[user]\n"
 		      "# Please adapt and uncomment the following lines:\n"
-		      "#	user = %s\n"
+		      "#	name = %s\n"
 		      "#	email = %s\n"),
 		    ident_default_name(),
 		    ident_default_email());
Signature · 1 line
2.4.0.rc3
#1 lore raw
Quoted 5 lines · Pete Harlan

When the user asks to edit an empty .gitconfig file, we learned to generate a default version in 9830534e (config --global --edit: create a template file if needed, 2014-07-25), but the generated config mistakenly set core.user and core.email instead of user.name and user.email.

Oops, indeed. I don't know how I could came up with such mistake and not notice.

Signature · 2 lines
Matthieu Moy
http://www-verimag.imag.fr/~moy/
#2 lore raw
In reply to Pete Harlan
Quoted 8 lines · Pete Harlan

When the user asks to edit an empty .gitconfig file, we learned to generate a default version in 9830534e (config --global --edit: create a template file if needed, 2014-07-25), but the generated config mistakenly set core.user and core.email instead of user.name and user.email. Fix this.

---

Thanks, I think this was already done in 7e110524 (config: fix settings in default_user_config template, 2015-04-17).

Quoted 23 lines

I ran up against this yesterday and it is easy enough to fix, but I don't have time right now to write tests for it.

 builtin/config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
builtin/config.c +2 -2
index d32c532..bfd3016 100644
@@ -455,9 +455,9 @@ static char *default_user_config(void)
 	struct strbuf buf = STRBUF_INIT;
 	strbuf_addf(&buf,
 		    _("# This is Git's per-user configuration file.\n"
-		      "[core]\n"
+		      "[user]\n"
 		      "# Please adapt and uncomment the following lines:\n"
-		      "#	user = %s\n"
+		      "#	name = %s\n"
 		      "#	email = %s\n"),
 		    ident_default_name(),
 		    ident_default_email());
#3 lore raw
Quoted 2 lines · Junio C Hamano

Thanks, I think this was already done in 7e110524 (config: fix settings in default_user_config template, 2015-04-17).

Whoops......indeed, I'll check more than just master next time, thanks.

--Pete

#4 lore raw
Quoted 5 lines · Pete Harlan
Quoted 2 lines · Junio C Hamano

Thanks, I think this was already done in 7e110524 (config: fix settings in default_user_config template, 2015-04-17).

Whoops......indeed, I'll check more than just master next time, thanks.

Building 'next' and using it for your everyday Git need is a good thing to do. You'll get well-eyeballed fixes earlier that way.