git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] config --global --edit: generate correct .gitconfig template

From
PHPete Harlan <pchpublic88@gmail.com>
Date
May 6, 2015, 17:41 UTC
Message-ID
<1430934077-20724-1-git-send-email-pchpublic88@gmail.com>

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.

Signed-off-by: Pete Harlan <pchpublic88@gmail.com>
---

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(-)
diff --git a/builtin/config.c b/builtin/config.c
index d32c532..bfd3016 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -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());
-- 
2.4.0.rc3
Next: Junio C Hamano
Message 1 of 5 in “config --global --edit: generate correct .gitconfig template”
  1. config --global --edit: generate correct .gitconfig templatePete Harlan, May 6, 2015
  2. Junio C HamanoMay 6, 2015
  3. Pete HarlanMay 6, 2015
  4. Junio C HamanoMay 7, 2015
  5. Matthieu MoyMay 7, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.