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

Re: BUG: Various "advice.*" config doesn't work

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 31, 2022, 17:46 UTC
Message-ID
<xmqqv8xziyrr.fsf@gitster.g>
In-Reply-To
<YfgdsnfQ05ywre8l@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
> What I'm more or less trying to point out is that an unguarded advise()
> function defeats the purpose of the advice API, which should exist to
> avoid mistakes like these (where advice is printed to the user when they
> have already opted out of that advice).

advise() falls into the same category as die(), warning(), and error(). It is a way to consistently format (and with a better design to line-wrap, than its older brethren) messages.

We do not have "die_if(condition, format, ...)", but if there were such a thing, that would be a good analogy to advice_if_enabled().

And a short-hand of die_if() would not make die() any unnecessary.
Previous: Taylor Blau
Message 5 of 5 in “BUG: Various "advice.*" config doesn't work”
  1. Ævar Arnfjörð BjarmasonJan 28, 2022
  2. Taylor BlauJan 31, 2022
  3. Junio C HamanoJan 31, 2022
  4. Taylor BlauJan 31, 2022
  5. Junio C HamanoJan 31, 2022

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.