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

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

From
RR4NC <ub4nal@mail.ru>
Date
Sep 9, 2026, 06:49 UTC
Message-ID
<9b4f43d7-ba77-4859-8efe-facdec6ec5aa@mail.ru>
In-Reply-To
<xmqqik4fwoz5.fsf@gitster.g>
 > One minor glitch is that there is an ad-hoc vadvise() call in
 > advise() that is not tied to any particular entry in the
 > advise_setting[] table.
I agree that we should use a separate "advice_setting" structure for this.
 > I think we'd need to give a name to the advice_setting struct type,
 > instanciate an ad-hoc instance on stack, and pass it down the callchain.

I agree. However, "advise()" originally passed "0" for "display_instructions", while "advise_if_enabled()" passed the negation of "level". With the new interface, we need a non-zero value for the ad-hoc setting to suppress the instructions. Using "ADVICE_LEVEL_ENABLED" or "ADVICE_LEVEL_DISABLED" would be a hack.

I suggest adding a dedicated "ADVICE_LEVEL_UNKNOWN" value to "enum advice_level" for this case.

Previous: Junio C HamanoNext: Jeff King
Message 10 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.