1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-24 07:07:17 +02:00
git/contrib/coccinelle
Jeff King 9001dc2a74 convert "oidcmp() != 0" to "!oideq()"
This is the flip side of the previous two patches: checking
for a non-zero oidcmp() can be more strictly expressed as
inequality. Like those patches, we write "!= 0" in the
coccinelle transformation, which covers by isomorphism the
more common:

  if (oidcmp(E1, E2))

As with the previous two patches, this patch can be achieved
almost entirely by running "make coccicheck"; the only
differences are manual line-wrap fixes to match the original
code.

There is one thing to note for anybody replicating this,
though: coccinelle 1.0.4 seems to miss the case in
builtin/tag.c, even though it's basically the same as all
the others. Running with 1.0.7 does catch this, so
presumably it's just a coccinelle bug that was fixed in the
interim.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-29 11:32:49 -07:00
..
.gitignore gitignore: ignore output files of coccicheck make target 2016-09-27 14:02:19 -07:00
README contrib/coccinelle: add basic Coccinelle transforms 2016-06-28 11:39:02 -07:00
array.cocci coccinelle: remove parentheses that become unnecessary 2017-10-02 13:02:26 +09:00
commit.cocci coccinelle: use <...> for function exclusion 2018-08-29 11:32:49 -07:00
free.cocci coccinelle: polish FREE_AND_NULL rules 2017-06-29 10:46:16 -07:00
object_id.cocci convert "oidcmp() != 0" to "!oideq()" 2018-08-29 11:32:49 -07:00
qsort.cocci remove unnecessary check before QSORT 2016-09-29 15:42:18 -07:00
strbuf.cocci Merge branch 'rs/cocci-strbuf-addf-to-addstr' 2018-02-15 14:55:44 -08:00
swap.cocci add SWAP macro 2017-01-30 14:07:45 -08:00
xstrdup_or_null.cocci abspath: add absolute_pathdup() 2017-01-26 14:51:06 -08:00

This directory provides examples of Coccinelle (http://coccinelle.lip6.fr/)
semantic patches that might be useful to developers.