Skip to content
  • Heba Waly's avatar
    advice: revamp advise API · b3b18d16
    Heba Waly authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    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: default avatarHeba Waly <heba.waly@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    b3b18d16