git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] string_list API users: use alloc + init, not calloc + strdup_strings
@ 2022-07-21  6:39 Ævar Arnfjörð Bjarmason
  2022-07-21  6:39 ` [PATCH 1/2] string_list API users + cocci: use string_list_init_dup() Ævar Arnfjörð Bjarmason
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-07-21  6:39 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Elijah Newren,
	Ævar Arnfjörð Bjarmason

As a small follow-up to Junio's
https://lore.kernel.org/git/xmqq7d471dns.fsf@gitster.g/; This is a
small set of fixes to use the string_list functions rather than
peeking into its guts during initalization.

I've been running my local git version with these changes for almost a
year, but for submision I wrote a coccinelle rule to cover most of it
in 1/2, along with a tests using the new recently landed coccicheck
test support.

The 2/2 is then things I had to manually change still, which weren't
covered by the conservative rule.

Ævar Arnfjörð Bjarmason (2):
  string_list API users + cocci: use string_list_init_dup()
  string-list API users: manually use string_list_init_*()

 contrib/coccinelle/string_list.cocci     | 8 ++++++++
 contrib/coccinelle/tests/string_list.c   | 7 +++++++
 contrib/coccinelle/tests/string_list.res | 7 +++++++
 notes-utils.c                            | 4 ++--
 reflog-walk.c                            | 2 +-
 refs.c                                   | 4 ++--
 resolve-undo.c                           | 8 ++++----
 revision.c                               | 4 ++--
 8 files changed, 33 insertions(+), 11 deletions(-)
 create mode 100644 contrib/coccinelle/string_list.cocci
 create mode 100644 contrib/coccinelle/tests/string_list.c
 create mode 100644 contrib/coccinelle/tests/string_list.res

-- 
2.37.1.1095.g64a1e8362fd


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-07-21 12:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-21  6:39 [PATCH 0/2] string_list API users: use alloc + init, not calloc + strdup_strings Ævar Arnfjörð Bjarmason
2022-07-21  6:39 ` [PATCH 1/2] string_list API users + cocci: use string_list_init_dup() Ævar Arnfjörð Bjarmason
2022-07-21  6:39 ` [PATCH 2/2] string-list API users: manually use string_list_init_*() Ævar Arnfjörð Bjarmason
2022-07-21  7:48   ` Elijah Newren
2022-07-21 12:00 ` [PATCH v2 0/6] string-list API user: fix API use, some with coccinelle Ævar Arnfjörð Bjarmason
2022-07-21 12:00   ` [PATCH v2 1/6] string_list API users + cocci: use string_list_init_dup() Ævar Arnfjörð Bjarmason
2022-07-21 12:00   ` [PATCH v2 2/6] cocci: apply string_list.cocci with --disable-worth-trying-opt Ævar Arnfjörð Bjarmason
2022-07-21 12:00   ` [PATCH v2 3/6] reflog-walk.c: use string_list_init_dup() Ævar Arnfjörð Bjarmason
2022-07-21 12:00   ` [PATCH v2 4/6] cocci: add "string_list" rule to swap "DUP" <-> "NODUP" Ævar Arnfjörð Bjarmason
2022-07-21 12:00   ` [PATCH v2 5/6] string-list API users: don't tweak "strdup_strings" to free dupes Ævar Arnfjörð Bjarmason
2022-07-21 12:00   ` [PATCH v2 6/6] notes.c: make "struct string_list display_notes_refs" non-static Ævar Arnfjörð Bjarmason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).