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

Re: [PATCH] advice: use global config for default branch name

From
Ben Knoble <ben.knoble@gmail.com>
Date
Sep 8, 2026, 13:35 UTC
Message-ID
<90671DEB-7A41-47DA-B865-AB963AEC11D1@gmail.com>
In-Reply-To
<20260907125610.23458-1-ub4nal@mail.ru>
Show 7 quoted lines
> Le 7 sept. 2026 à 09:02, Vsevolod Myalitsin <ub4nal@mail.ru> a écrit :
> 
> 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.
Makes sense.
> Suggest using "git config --global" instead.

I think we should probably say “git config set --global …” using the modern forms, no?

Show 25 quoted lines
> 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);
This would be hard to extend later for other advice options that also make more sense at the global level. Perhaps extract a little helper is_global(key)?
Thanks
Previous: Vsevolod MyalitsinNext: Vsevolod Myalitsin
Message 2 of 19 in “advice: use global config for default branch name”
  1. advice: use global config for default branch nameVsevolod Myalitsin, Sep 7, 2026
  2. Ben KnobleSep 8, 2026
  3. advice: use global config for default branch nameVsevolod Myalitsin, Sep 8, 2026
  4. Ben KnobleSep 8, 2026
  5. R4NCSep 8, 2026
  6. D. Ben KnobleSep 8, 2026
  7. Junio C HamanoSep 8, 2026
  8. advice: use global config for default branch nameVsevolod Myalitsin, Sep 8, 2026
  9. Junio C HamanoSep 8, 2026
  10. R4NCSep 9, 2026
  11. Jeff KingSep 9, 2026
  12. Junio C HamanoSep 9, 2026
  13. Jeff KingSep 9, 2026
  14. Junio C HamanoSep 10, 2026
  15. Jeff KingSep 10, 2026
  16. Junio C HamanoSep 10, 2026
  17. Jeff KingSep 10, 2026
  18. Junio C HamanoSep 10, 2026
  19. Vsevolod MyalitsinAug 29, 2027

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.