]> git.ipfire.org Git - thirdparty/git.git/commit - Makefile
advice: revamp advise API
authorHeba Waly <heba.waly@gmail.com>
Mon, 2 Mar 2020 20:01:59 +0000 (20:01 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Mar 2020 14:15:02 +0000 (06:15 -0800)
commitb3b18d1621315fb187689ee6c759bdbbea214eb8
tree71cdc12a22546b811b17a8b73e8c8e9ec349d3f9
parentfef0c76f1802c42f1d1f3b6344deb182a3600625
advice: revamp advise API

Currently it's very easy for the advice library's callers to miss
checking the visibility step before printing an advice. Also, it makes
more sense for this step to be handled by the advice library.

Add a new advise_if_enabled function that checks the visibility of
advice messages before printing.

Add a new helper advise_enabled to check the visibility of the advice
if the caller needs to carry out complicated processing based on that
value.

A list of advice_settings is added to cache the config variables names
and values, it's intended to replace advice_config[] and the global
variables once we migrate all the callers to use the new APIs.

Signed-off-by: Heba Waly <heba.waly@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
advice.c
advice.h
t/helper/test-advise.c [new file with mode: 0644]
t/helper/test-tool.c
t/helper/test-tool.h
t/t0018-advice.sh [new file with mode: 0755]