{"thread":{"id":"58197","subject":"[PATCH] string_list: use the right kind of STRING_LIST_INIT","startedAt":"2022-07-21T01:02:24Z","lastAt":"2022-07-25T19:01:12Z","messageCount":5,"participants":["Junio C Hamano","Elijah Newren","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"459558","messageId":"xmqq7d471dns.fsf@gitster.g","threadId":"58197","inReplyTo":null,"subject":"[PATCH] string_list: use the right kind of STRING_LIST_INIT","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-07-21T01:02:15Z","receivedAt":"2022-07-21T01:02:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Since 4a4b4cda (builtin-remote: Make \"remote -v\" display push urls,\n2009-06-13), the string_list that was initialized with 0 in its\nstrdup_string member is immediately made to strdup its key strings\nby flipping the strdup_string member to true.  When 183113a5\n(string_list: Add STRING_LIST_INIT macro and make use of it.,\n2010-07-04) has introduced STRING_LIST_INIT macros, it mechanically\nreplaced the initialization to STRING_LIST_INIT_NODUP.\n\nInstead, just use the other initialization macro to make it strdup\nthe key from the beginning.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin/remote.c | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git c/builtin/remote.c w/builtin/remote.c\nindex d9b8746cb3..c713463d89 100644\n--- c/builtin/remote.c\n+++ w/builtin/remote.c\n@@ -1229,10 +1229,9 @@ static int get_one_entry(struct remote *remote, void *priv)\n \n static int show_all(void)\n {\n-\tstruct string_list list = STRING_LIST_INIT_NODUP;\n+\tstruct string_list list = STRING_LIST_INIT_DUP;\n \tint result;\n \n-\tlist.strdup_strings = 1;\n \tresult = for_each_remote(get_one_entry, &list);\n \n \tif (!result) {\n"},{"id":"459565","messageId":"CABPp-BFUoufmoQx8Oq=3C1ct-7paBs1fqzi8b8jhOadrndGkkg@mail.gmail.com","threadId":"58197","inReplyTo":"xmqq7d471dns.fsf@gitster.g","subject":"Re: [PATCH] string_list: use the right kind of STRING_LIST_INIT","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2022-07-21T03:28:45Z","receivedAt":"2022-07-21T03:29:01Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Wed, Jul 20, 2022 at 6:19 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Since 4a4b4cda (builtin-remote: Make \"remote -v\" display push urls,\n> 2009-06-13), the string_list that was initialized with 0 in its\n> strdup_string member is immediately made to strdup its key strings\n> by flipping the strdup_string member to true.  When 183113a5\n> (string_list: Add STRING_LIST_INIT macro and make use of it.,\n> 2010-07-04) has introduced STRING_LIST_INIT macros, it mechanically\n> replaced the initialization to STRING_LIST_INIT_NODUP.\n>\n> Instead, just use the other initialization macro to make it strdup\n> the key from the beginning.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  builtin/remote.c | 3 +--\n>  1 file changed, 1 insertion(+), 2 deletions(-)\n>\n> diff --git c/builtin/remote.c w/builtin/remote.c\n> index d9b8746cb3..c713463d89 100644\n> --- c/builtin/remote.c\n> +++ w/builtin/remote.c\n> @@ -1229,10 +1229,9 @@ static int get_one_entry(struct remote *remote, void *priv)\n>\n>  static int show_all(void)\n>  {\n> -       struct string_list list = STRING_LIST_INIT_NODUP;\n> +       struct string_list list = STRING_LIST_INIT_DUP;\n>         int result;\n>\n> -       list.strdup_strings = 1;\n>         result = for_each_remote(get_one_entry, &list);\n>\n>         if (!result) {\n\nMakes sense, but shouldn't the subject have s/string-list:/remote:/ ?\n"},{"id":"459568","messageId":"xmqqk087m5v1.fsf@gitster.g","threadId":"58197","inReplyTo":"CABPp-BFUoufmoQx8Oq=3C1ct-7paBs1fqzi8b8jhOadrndGkkg@mail.gmail.com","subject":"Re: [PATCH] string_list: use the right kind of STRING_LIST_INIT","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-07-21T04:45:06Z","receivedAt":"2022-07-21T04:45:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elijah Newren <newren@gmail.com> writes:\n\n> Makes sense, but shouldn't the subject have s/string-list:/remote:/ ?\n\nOh, you are absolutely right.\n\nI was influenced by 183113a5 (string_list: Add STRING_LIST_INIT\nmacro and make use of it., 2010-07-04), which I was staring at too\nmuch while thinking that this fix was finishing up what it started.\n\nWill amend.  Thanks.\n"},{"id":"459570","messageId":"220721.868ronuhrm.gmgdl@evledraar.gmail.com","threadId":"58197","inReplyTo":"xmqq7d471dns.fsf@gitster.g","subject":"Re: [PATCH] string_list: use the right kind of STRING_LIST_INIT","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-07-21T05:55:49Z","receivedAt":"2022-07-21T06:00:54Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Jul 20 2022, Junio C Hamano wrote:\n\n> Since 4a4b4cda (builtin-remote: Make \"remote -v\" display push urls,\n> 2009-06-13), the string_list that was initialized with 0 in its\n> strdup_string member is immediately made to strdup its key strings\n> by flipping the strdup_string member to true.  When 183113a5\n> (string_list: Add STRING_LIST_INIT macro and make use of it.,\n> 2010-07-04) has introduced STRING_LIST_INIT macros, it mechanically\n> replaced the initialization to STRING_LIST_INIT_NODUP.\n>\n> Instead, just use the other initialization macro to make it strdup\n> the key from the beginning.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  builtin/remote.c | 3 +--\n>  1 file changed, 1 insertion(+), 2 deletions(-)\n>\n> diff --git c/builtin/remote.c w/builtin/remote.c\n> index d9b8746cb3..c713463d89 100644\n> --- c/builtin/remote.c\n> +++ w/builtin/remote.c\n> @@ -1229,10 +1229,9 @@ static int get_one_entry(struct remote *remote, void *priv)\n>  \n>  static int show_all(void)\n>  {\n> -\tstruct string_list list = STRING_LIST_INIT_NODUP;\n> +\tstruct string_list list = STRING_LIST_INIT_DUP;\n>  \tint result;\n>  \n> -\tlist.strdup_strings = 1;\n>  \tresult = for_each_remote(get_one_entry, &list);\n>  \n>  \tif (!result) {\n\nHeh :) I think it's safe to give this my Reviewed-By, since I've been\nrunning with this patch for almost a year now:\nhttps://github.com/avar/git/commit/bdf4466eb92\n\nIt's on a branch of some WIP string_list API fixes that I haven't sent\nin, but the fix looks good to me...\n"},{"id":"459905","messageId":"xmqqlesh3tla.fsf@gitster.g","threadId":"58197","inReplyTo":"220721.868ronuhrm.gmgdl@evledraar.gmail.com","subject":"Re: [PATCH] string_list: use the right kind of STRING_LIST_INIT","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-07-25T19:01:05Z","receivedAt":"2022-07-25T19:01:12Z","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> Heh :) I think it's safe to give this my Reviewed-By, since I've been\n> running with this patch for almost a year now:\n> https://github.com/avar/git/commit/bdf4466eb92\n>\n> It's on a branch of some WIP string_list API fixes that I haven't sent\n> in, but the fix looks good to me...\n\nI do not think it is all that urgent, but I do not think it is worth\nwasting our braincells to remember that a WIP series is waiting to\ntouch and update this area again, so I'll merge this single patch\ndown to 'next' and 'master' soonish.\n\nThanks.\n"}]}