From: Dragan Simic <dsimic@manjaro.org>
To: Jeff King <peff@peff.net>
Cc: "Rubén Justo" <rjusto@gmail.com>, "Git List" <git@vger.kernel.org>
Subject: Re: [PATCH 3/3] advice: allow disabling the automatic hint in advise_if_enabled()
Date: Wed, 10 Jan 2024 15:18:17 +0100 [thread overview]
Message-ID: <aaf59fc82ef3132ece8e1f70623570a2@manjaro.org> (raw)
In-Reply-To: <20240110110226.GC16674@coredump.intra.peff.net>
On 2024-01-10 12:02, Jeff King wrote:
> On Tue, Jan 09, 2024 at 04:30:16PM +0100, Rubén Justo wrote:
>
>> Using advise_if_enabled() to display an advice will automatically
>> include instructions on how to disable the advice, along with the
>> main advice:
>>
>> hint: use --reapply-cherry-picks to include skipped commits
>> hint: Disable this message with "git config advice.skippedCherryPicks
>> false"
>>
>> This can become distracting or noisy over time, while the user may
>> still want to receive the main advice.
>>
>> Let's have a switch to allow disabling this automatic advice.
>
> If I'm reading your patch correctly, this is a single option that
> controls the extra line for _all_ advice messages. But I'd have
> expected
> this to be something you'd want to set on a per-message basis. Here's
> my
> thinking.
>
> The original idea for advice messages was that they might be verbose
> and
> annoying, but if you had one that showed up a lot you'd choose to shut
> it up individually. But you wouldn't do so for _all_ messages, because
> you might benefit from seeing others (including new ones that get
> added). The "Disable this..." part was added later to help you easily
> know which config option to tweak.
Just to chime in and support this behavior of the advice messages.
Basically, you don't want to have them all disabled at the same time,
but to have per-message enable/disable granularity. I'd guess that some
of the messages are quite usable even to highly experienced users, and
encountering newly added messages is also very useful. Thus, having
them all disabled wouldn't be the best idea.
> The expectation was that you'd fall into one of two categories:
>
> 1. You don't see the message often enough to care, so you do nothing.
>
> 2. You do find it annoying, so you disable this instance.
>
> Your series proposes a third state:
>
> 3. You find the actual hint useful, but the verbosity of "how to shut
> it up" is too much for you.
>
> That make sense to me, along with being able to partially shut-up a
> message. But wouldn't you still need the "how to shut up" hint for
> _other_ messages, since it's customized for each situation?
>
> E.g., suppose that after getting annoyed at advice.skippedCherryPicks,
> you run "git config advice.adviseOff false".
>
> But now you run into another hint, like:
>
> $ git foo
> hint: you can use --empty-commits to deal with isn't as good as
> --xyzzy
>
> and you want to disable it entirely. Which advice.* config option does
> so? You're stuck trying to find it in the manpage (which is tedious but
> also kind of tricky since you're now guessing which name goes with
> which
> message). You probably do want:
>
> hint: Disable this message with "git config advice.xyzzy false"
>
> in that case (at which point you may decide to silence it completely or
> partially).
>
> Which implies to me that the value of advice.* should be a tri-state to
> match the cases above: true, false, or a "minimal" / "quiet" mode
> (there
> might be a better name). And then you'd do:
>
> git config advice.skippedCherryPicks minimal
>
> (or whatever it is called) to get the mode you want, without affecting
> advice.xyzzy.
>
>> advice.c | 3 ++-
>> advice.h | 3 ++-
>> t/t0018-advice.sh | 8 ++++++++
>> 3 files changed, 12 insertions(+), 2 deletions(-)
>
> Speaking of manpages, we'd presumably need an update to
> Documentation/config/advice.txt. :)
>
> -Peff
next prev parent reply other threads:[~2024-01-10 14:18 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-09 15:25 [PATCH 0/3] allow disabling the automatic hint in advise_if_enabled() Rubén Justo
2024-01-09 15:29 ` [PATCH 1/3] t/test-tool: usage description Rubén Justo
2024-01-09 18:19 ` Junio C Hamano
2024-01-09 15:29 ` [PATCH 2/3] t/test-tool: handle -c <name>=<value> arguments Rubén Justo
2024-01-09 18:19 ` Junio C Hamano
2024-01-09 18:20 ` Taylor Blau
2024-01-09 15:30 ` [PATCH 3/3] advice: allow disabling the automatic hint in advise_if_enabled() Rubén Justo
2024-01-09 18:23 ` Junio C Hamano
2024-01-09 18:27 ` Taylor Blau
2024-01-09 19:57 ` Junio C Hamano
2024-01-10 12:11 ` Rubén Justo
2024-01-10 11:02 ` Jeff King
2024-01-10 11:39 ` Rubén Justo
2024-01-10 14:18 ` Dragan Simic [this message]
2024-01-10 14:32 ` Rubén Justo
2024-01-10 14:44 ` Dragan Simic
2024-01-10 16:22 ` Junio C Hamano
2024-01-10 17:45 ` Dragan Simic
2024-01-11 8:04 ` Jeff King
2024-01-18 6:15 ` Dragan Simic
2024-01-18 18:26 ` Junio C Hamano
2024-01-18 18:53 ` Dragan Simic
2024-01-18 20:19 ` Junio C Hamano
2024-01-18 20:50 ` Dragan Simic
2024-01-20 11:31 ` Rubén Justo
2024-01-20 15:31 ` Dragan Simic
2024-01-10 16:14 ` Junio C Hamano
2024-01-09 18:28 ` [PATCH 0/3] " Taylor Blau
2024-01-09 22:32 ` Junio C Hamano
2024-01-10 12:40 ` Rubén Justo
2024-01-12 10:05 ` [PATCH] advice: " Rubén Justo
2024-01-12 22:19 ` Junio C Hamano
2024-01-13 7:38 ` Jeff King
2024-01-16 4:56 ` Junio C Hamano
2024-01-15 11:24 ` Rubén Justo
2024-01-15 14:28 ` [PATCH v2] " Rubén Justo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aaf59fc82ef3132ece8e1f70623570a2@manjaro.org \
--to=dsimic@manjaro.org \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=rjusto@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).