git-commit-vandalism/contrib/coccinelle
René Scharfe 33ad9ddd0b strbuf: add strbuf_add_real_path()
Add a function for appending the canonized absolute pathname of a given
path to a strbuf.  It keeps the existing contents intact, as expected of
a function of the strbuf_add() family, while avoiding copying the result
if the given strbuf is empty.  It's more consistent with the rest of the
strbuf API than strbuf_realpath(), which it's wrapping.

Also add a semantic patch demonstrating its intended usage and apply it
to the current tree.  Using strbuf_add_real_path() instead of calling
strbuf_addstr() and real_path() avoids an extra copy to a static buffer.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-27 11:02:06 -08:00
..
.gitignore gitignore: ignore output files of coccicheck make target 2016-09-27 14:02:19 -07:00
array.cocci cocci: use ALLOC_ARRAY 2017-02-27 11:02:05 -08:00
free.cocci remove unnecessary NULL check before free(3) 2016-10-10 11:37:41 -07:00
object_id.cocci cocci: avoid self-references in object_id transformations 2016-11-01 10:58:39 -07:00
qsort.cocci remove unnecessary check before QSORT 2016-09-29 15:42:18 -07:00
README contrib/coccinelle: add basic Coccinelle transforms 2016-06-28 11:39:02 -07:00
strbuf.cocci strbuf: add strbuf_add_real_path() 2017-02-27 11:02:06 -08:00
xstrdup_or_null.cocci cocci: refactor common patterns to use xstrdup_or_null() 2016-10-12 11:22:10 -07:00

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