From: Rubén Justo Date: Fri, 29 Mar 2024 19:16:27 GMT Subject: Re: [PATCH 0/3] add: use advise_if_enabled Message-ID: <1c3bc5ba-0093-4a34-ade2-d6762e9754b3@gmail.com> In-Reply-To: On Fri, Mar 29, 2024 at 10:28:34AM -0700, Junio C Hamano wrote: > Rubén Justo 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.