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.