Git development
 help / color / mirror / Atom feed
* [PATCH] advice: use global config for default branch name
@ 2026-09-07 12:56 Vsevolod Myalitsin
  2026-09-08 13:35 ` Ben Knoble
  0 siblings, 1 reply; 19+ messages in thread
From: Vsevolod Myalitsin @ 2026-09-07 12:56 UTC (permalink / raw)
  To: git; +Cc: Vsevolod Myalitsin

The advice for configuring the default branch name
suggests disabling it with "git config set
advice.defaultBranchName false". This setting is
useless because it neither affects the current
repository nor newly created repositories.

Suggest using "git config --global" instead.

Signed-off-by: Vsevolod Myalitsin <ub4nal@mail.ru>
---
 advice.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/advice.c b/advice.c
index 63bf8b0c5f..64ca4613b4 100644
--- a/advice.c
+++ b/advice.c
@@ -96,7 +96,7 @@ static struct {
 
 static const char turn_off_instructions[] =
 N_("\n"
-   "Disable this message with \"git config set advice.%s false\"");
+   "Disable this message with \"git config %s advice.%s false\"");
 
 static void vadvise(const char *advice, int display_instructions,
 		    const char *key, va_list params)
@@ -107,7 +107,8 @@ static void vadvise(const char *advice, int display_instructions,
 	strbuf_vaddf(&buf, advice, params);
 
 	if (display_instructions)
-		strbuf_addf(&buf, turn_off_instructions, key);
+		strbuf_addf(&buf, turn_off_instructions,
+			strcmp(key, "defaultBranchName") ? "set" : "--global", key);
 
 	for (cp = buf.buf; *cp; cp = np) {
 		np = strchrnul(cp, '\n');
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-09-10 16:31 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07 12:56 [PATCH] advice: use global config for default branch name Vsevolod Myalitsin
2026-09-08 13:35 ` Ben Knoble
2026-09-08 18:56   ` Vsevolod Myalitsin
2026-09-08 14:59     ` Ben Knoble
2026-09-08 19:56       ` R4NC
2026-09-08 16:24         ` D. Ben Knoble
2026-09-08 16:31     ` Junio C Hamano
2026-09-08 21:38       ` Vsevolod Myalitsin
2026-09-08 18:57         ` Junio C Hamano
2026-09-09  6:49           ` R4NC
2026-09-09 15:54           ` Jeff King
2026-09-09 18:51             ` Junio C Hamano
2026-09-09 19:51               ` Jeff King
2026-09-10  4:23                 ` Junio C Hamano
2026-09-10  4:33                   ` Jeff King
2026-09-10 12:18                     ` Junio C Hamano
2026-09-10 16:31                       ` Jeff King
2026-09-10  4:28                 ` Junio C Hamano
2027-08-29  0:59               ` Vsevolod Myalitsin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox