{"thread":{"id":"56601","subject":"[PATCH] string-list.[ch]: remove string_list_init() compatibility function","startedAt":"2021-09-28T12:49:51Z","lastAt":"2021-09-28T21:43:15Z","messageCount":3,"participants":["Ævar Arnfjörð Bjarmason","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"437284","messageId":"patch-1.1-03c805dd90f-20210928T124939Z-avarab@gmail.com","threadId":"56601","inReplyTo":null,"subject":"[PATCH] string-list.[ch]: remove string_list_init() compatibility function","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-09-28T12:49:45Z","receivedAt":"2021-09-28T12:49:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Remove this function left over to accommodate in-flight changes, see\n770fedaf9fb (string-list.[ch]: add a string_list_init_{nodup,dup}(),\n2021-07-01) for the recent change to add\n\"string_list_init_{nodup,dup}()\" initializers.\n\nThere was only one user of the API left in remote-curl.c. I don't know\nwhy I didn't include this change to remote-curl.c in\nbc40dfb10a0 (string-list.h users: change to use *_{nodup,dup}(),\n2021-07-01), perhaps I just missed it.\n\nIn any case, let's change that one user to use the new API, as of\nwriting this there are no in-flight changes that use, so this seems\nlike a good time to drop this before we get any new users of this\ncompatibility API.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n remote-curl.c | 4 ++--\n string-list.c | 8 --------\n string-list.h | 5 -----\n 3 files changed, 2 insertions(+), 15 deletions(-)\n\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 598cff7cde6..3f5688e4262 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -1478,8 +1478,8 @@ int cmd_main(int argc, const char **argv)\n \toptions.verbosity = 1;\n \toptions.progress = !!isatty(2);\n \toptions.thin = 1;\n-\tstring_list_init(&options.deepen_not, 1);\n-\tstring_list_init(&options.push_options, 1);\n+\tstring_list_init_dup(&options.deepen_not);\n+\tstring_list_init_dup(&options.push_options);\n \n \t/*\n \t * Just report \"remote-curl\" here (folding all the various aliases\ndiff --git a/string-list.c b/string-list.c\nindex 43576ad1265..549fc416d68 100644\n--- a/string-list.c\n+++ b/string-list.c\n@@ -13,14 +13,6 @@ void string_list_init_dup(struct string_list *list)\n \tmemcpy(list, &blank, sizeof(*list));\n }\n \n-void string_list_init(struct string_list *list, int strdup_strings)\n-{\n-\tif (strdup_strings)\n-\t\tstring_list_init_dup(list);\n-\telse\n-\t\tstring_list_init_nodup(list);\n-}\n-\n /* if there is no exact match, point to the index where the entry could be\n  * inserted */\n static int get_entry_index(const struct string_list *list, const char *string,\ndiff --git a/string-list.h b/string-list.h\nindex 0d6b4692396..267d6e5769d 100644\n--- a/string-list.h\n+++ b/string-list.h\n@@ -104,11 +104,6 @@ struct string_list {\n void string_list_init_nodup(struct string_list *list);\n void string_list_init_dup(struct string_list *list);\n \n-/**\n- * TODO remove: For compatibility with any in-flight older API users\n- */\n-void string_list_init(struct string_list *list, int strdup_strings);\n-\n /** Callback function type for for_each_string_list */\n typedef int (*string_list_each_func_t)(struct string_list_item *, void *);\n \n-- \n2.33.0.1340.ge9f77250f2b\n\n"},{"id":"437340","messageId":"YVNYT671T5vC2qrY@coredump.intra.peff.net","threadId":"56601","inReplyTo":"patch-1.1-03c805dd90f-20210928T124939Z-avarab@gmail.com","subject":"Re: [PATCH] string-list.[ch]: remove string_list_init() compatibility function","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-09-28T18:00:47Z","receivedAt":"2021-09-28T18:00:50Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 28, 2021 at 02:49:45PM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> Remove this function left over to accommodate in-flight changes, see\n> 770fedaf9fb (string-list.[ch]: add a string_list_init_{nodup,dup}(),\n> 2021-07-01) for the recent change to add\n> \"string_list_init_{nodup,dup}()\" initializers.\n> \n> There was only one user of the API left in remote-curl.c. I don't know\n> why I didn't include this change to remote-curl.c in\n> bc40dfb10a0 (string-list.h users: change to use *_{nodup,dup}(),\n> 2021-07-01), perhaps I just missed it.\n\nYeah, both calls definitely existed then. I agree it was probably just\nmissed (at least there is no obvious reason not to have included it\nthen).\n\n> In any case, let's change that one user to use the new API, as of\n> writing this there are no in-flight changes that use, so this seems\n> like a good time to drop this before we get any new users of this\n> compatibility API.\n\nYeah, this seems like a good idea. The patch itself is as advertised.\n\n-Peff\n"},{"id":"437368","messageId":"xmqqzgrwidg3.fsf@gitster.g","threadId":"56601","inReplyTo":"patch-1.1-03c805dd90f-20210928T124939Z-avarab@gmail.com","subject":"Re: [PATCH] string-list.[ch]: remove string_list_init() compatibility function","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-09-28T21:43:08Z","receivedAt":"2021-09-28T21:43:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> Remove this function left over to accommodate in-flight changes, see\n> 770fedaf9fb (string-list.[ch]: add a string_list_init_{nodup,dup}(),\n> 2021-07-01) for the recent change to add\n> \"string_list_init_{nodup,dup}()\" initializers.\n>\n> There was only one user of the API left in remote-curl.c. I don't know\n> why I didn't include this change to remote-curl.c in\n> bc40dfb10a0 (string-list.h users: change to use *_{nodup,dup}(),\n> 2021-07-01), perhaps I just missed it.\n>\n> In any case, let's change that one user to use the new API, as of\n> writing this there are no in-flight changes that use, so this seems\n> like a good time to drop this before we get any new users of this\n> compatibility API.\n>\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n\nThanks.\n"}]}