Re: Coccinelle for automated refactors

2016-06-06 Thread brian m. carlson
On Mon, Jun 06, 2016 at 11:55:50AM -0700, Junio C Hamano wrote: > Is the plan for such a "refactor" patch to compose such a series as > two patch series: > > [1/2] automatic refactor > > which gives the "semantic patch" in the proposed log message as part > of its description, and the automated

Re: Coccinelle for automated refactors

2016-06-06 Thread Jacob Keller
On Mon, Jun 6, 2016 at 11:55 AM, Junio C Hamano wrote: > "brian m. carlson" writes: > >> An example semantic patch looks like this: >> >> @@ >> expression E1; >> @@ >> - is_null_sha1(E1.hash) >> + is_null_oid() >> >> @@ >> expression E1; >> @@ >>

Re: Coccinelle for automated refactors

2016-06-06 Thread Junio C Hamano
"brian m. carlson" writes: > An example semantic patch looks like this: > > @@ > expression E1; > @@ > - is_null_sha1(E1.hash) > + is_null_oid() > > @@ > expression E1; > @@ > - is_null_sha1(E1->hash) > + is_null_oid(E1) > > This does what you think it does:

Re: Coccinelle for automated refactors

2016-06-06 Thread Stefan Beller
On Sun, Jun 5, 2016 at 1:55 PM, brian m. carlson wrote: > One thing that I've noticed with the struct object_id conversion is that > most of the work is mechanical transformations of a data member from one > type into another. Doing this by hand is both boring and

Coccinelle for automated refactors

2016-06-05 Thread brian m. carlson
One thing that I've noticed with the struct object_id conversion is that most of the work is mechanical transformations of a data member from one type into another. Doing this by hand is both boring and error-prone, and it requires a tiresome review of nearly-identical changes. I've noticed that