Re: [PATCH] advice: refactor advise API
- From
Heba Waly <heba.waly@gmail.com>
- Date
- Feb 11, 2020, 02:01 UTC
- Message-ID
- <CACg5j26RAEdABySzpDEYmo4m+HDPn9jNDP087d3K9gCro4m-Sg@mail.gmail.com>
- In-Reply-To
- <xmqqeev2xdq8.fsf@gitster-ct.c.googlers.com>
On Tue, Feb 11, 2020 at 11:46 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> > > As I outlined in [1], I think the over-simplified > "advise_ng(<advise.key>, _(<message>), ...)" would be too limited > to replace the current users, without a pair of helper functions, > one to just check for the guarding advise.key, and the other to > unconditionally show the message (i.e. the latter is what the > current advise() is). >
I agree with adding the first helper, specially after Peff's comments, but I don't see why we would keep the current advise() which unconditionally shows the message... As far as I understand from a previous discussion [3], that's a wrong usage that we need to avoid, quoting from [3]: ``` If there are many other places that calls to advise() are made without getting guarded by the toggles defined in advice.c, we should fix them, I think. ```
> > [1] > > https://public-inbox.org/git/xmqqzhf5cw69.fsf@gitster-ct.c.googlers.com/
[3] https://public-inbox.org/git/xmqqpng1eisc.fsf@gitster-ct.c.googlers.com/