Subject: Re: [PATCH 0/2] advice: add "all" option to disable all hints

From: Patrick Steinhardt <[email-masked]>
Date: Thu, 25 Apr 2024 08:46:31 +0200

On Wed, Apr 24, 2024 at 07:59:16AM -0700, Junio C Hamano wrote:
> Patrick Steinhardt <[email-masked]> writes:
> 
> > Filtering out advices would be doable. But we probably wouldn't want to
> > do so unconditionally whenever we execute Git commands.
> 
> Can you elaborate?  Would you only sometimes show advice messages
> that come from "git" you invoke?  Based on what criteria would it
> decide whether to filter or not to?  Is it purely per location in
> your program (i.e., "every time the control flow reaches this call
> to an equivalent of run_command(), we would filter the "hint:"
> messages")?
> 
> In an invocation where you would not filter, what effect does users'
> setting of advice.* configuration variables have, and what effect
> does a new and unseen kind of advice messages have?

The reason here is mostly that I do not know whether this can be rigged.
I cannot state without a doubt that no command may output "hint:" at the
start of a line that may _not_ actually be an advice. Think for example
(and I know this example is dumb because advice goes to stderr, not
stdout) git-cat-file(1) with a blob that contains a line saying "hint:".

Patrick