advice: allow disabling the automatic hint in advise_if_enabled()
commitd919965af116d145de40853caf0e4228c97da325
authorRubén Justo <rjusto@gmail.com>
Mon, 15 Jan 2024 14:28:28 +0000 (15 15:28 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Jan 2024 21:07:00 +0000 (16 13:07 -0800)
tree8fe658ea1937c98fc8fa1f761da7229f546c6c0b
parent8cf646faac355fb44199793fe1a080b82abffc29
advice: allow disabling the automatic hint in advise_if_enabled()

Using advise_if_enabled() to display an advice will automatically
include instructions on how to disable the advice, alongside the main
advice:

hint: use --reapply-cherry-picks to include skipped commits
hint: Disable this message with "git config advice.skippedCherryPicks false"

To do so, we provide a knob which can be used to disable the advice.

But also to tell us the opposite: to show the advice.

Let's not include the deactivation instructions for an advice if the
user explicitly sets its visibility.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/advice.txt
advice.c
t/t0018-advice.sh