Re: [PATCH 0/3] add: use advise_if_enabled
- From
Rubén Justo <rjusto@gmail.com>
- Date
- Mar 29, 2024, 19:16 UTC
- Message-ID
- <1c3bc5ba-0093-4a34-ade2-d6762e9754b3@gmail.com>
- In-Reply-To
- <xmqq1q7t0wxp.fsf@gitster.g>
On Fri, Mar 29, 2024 at 10:28:34AM -0700, Junio C Hamano wrote:
Show 16 quoted lines
> Rubén Justo <rjusto@gmail.com> writes: > > > This series is a simple change, in builtin/add.c, from: > > > > if (advice_enabled(XXX)) > > advise(MMM) > > I wonder if a coccinelle rule can automatically identify and rewrite > these ... > > > > > to the newer: > > > > advise_if_enabled(XXX, MMM) > > ... to this form automatically.
I don't have a solid opinion on that but, after a cursory review, I have doubts a simple rule could catch enough cases to make it worth the effort.
And, let's hope that the new code will utilize the new API for its convenience.