{"thread":{"id":"53160","subject":"[PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'","startedAt":"2020-04-02T22:58:27Z","lastAt":"2020-04-03T17:58:51Z","messageCount":5,"participants":["Shourya Shukla","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"394627","messageId":"20200402225807.8603-1-shouryashukla.oo@gmail.com","threadId":"53160","inReplyTo":null,"subject":"[PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-04-02T22:58:06Z","receivedAt":"2020-04-02T22:58:27Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Subcommands in 'submodule--helper.c' which give a callback to other functions\nhave structures and macros named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'\nrespectively.\n\nThe subcommand 'foreach' did not follow this convention and therefore had the naming of\nthe form: 'struct foreach_cb' and 'CB_FOREACH_INIT'. Rename these to: 'struct foreach_cb'\nand 'FOREACH_CB_INIT' respectively.\n\n\nShourya Shukla (1):\n  submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'\n\n builtin/submodule--helper.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\n-- \n2.20.1\n\n"},{"id":"394628","messageId":"20200402225807.8603-2-shouryashukla.oo@gmail.com","threadId":"53160","inReplyTo":"20200402225807.8603-1-shouryashukla.oo@gmail.com","subject":"[PATCH 1/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-04-02T22:58:07Z","receivedAt":"2020-04-02T22:58:30Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"In 'submodule--helper.c', the structures and macros for callbacks belonging\nto any subcommand are named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'\nrespectively.\n\nThis was an exception for the subcommand 'foreach' of the command\n'submodule'. Rename the aforementioned structures and macros:\n'struct cb_foreach' to 'struct foreach_cb' and 'CB_FOREACH_INIT'\nto 'FOREACH_CB_INIT'.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n builtin/submodule--helper.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\nindex 7d5996d3b3..a21e48730d 100644\n--- a/builtin/submodule--helper.c\n+++ b/builtin/submodule--helper.c\n@@ -444,19 +444,19 @@ static void for_each_listed_submodule(const struct module_list *list,\n \t\tfn(list->entries[i], cb_data);\n }\n \n-struct cb_foreach {\n+struct foreach_cb {\n \tint argc;\n \tconst char **argv;\n \tconst char *prefix;\n \tint quiet;\n \tint recursive;\n };\n-#define CB_FOREACH_INIT { 0 }\n+#define FOREACH_CB_INIT { 0 }\n \n static void runcommand_in_submodule_cb(const struct cache_entry *list_item,\n \t\t\t\t       void *cb_data)\n {\n-\tstruct cb_foreach *info = cb_data;\n+\tstruct foreach_cb *info = cb_data;\n \tconst char *path = list_item->name;\n \tconst struct object_id *ce_oid = &list_item->oid;\n \n@@ -557,7 +557,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,\n \n static int module_foreach(int argc, const char **argv, const char *prefix)\n {\n-\tstruct cb_foreach info = CB_FOREACH_INIT;\n+\tstruct foreach_cb info = FOREACH_CB_INIT;\n \tstruct pathspec pathspec;\n \tstruct module_list list = MODULE_LIST_INIT;\n \n-- \n2.20.1\n\n"},{"id":"394633","messageId":"xmqqo8s91ktt.fsf@gitster.c.googlers.com","threadId":"53160","inReplyTo":"20200402225807.8603-1-shouryashukla.oo@gmail.com","subject":"Re: [PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-04-03T00:20:30Z","receivedAt":"2020-04-03T00:20:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shourya Shukla <shouryashukla.oo@gmail.com> writes:\n\n> Subcommands in 'submodule--helper.c' which give a callback to other functions\n> have structures and macros named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'\n> respectively.\n>\n> The subcommand 'foreach' did not follow this convention and therefore had the naming of\n> the form: 'struct foreach_cb' and 'CB_FOREACH_INIT'. Rename these to: 'struct foreach_cb'\n> and 'FOREACH_CB_INIT' respectively.\n>\n>\n> Shourya Shukla (1):\n>   submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'\n>\n>  builtin/submodule--helper.c | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n\nIsn't this already in 'master'?\n\n"},{"id":"394642","messageId":"CAP6+3T2Kj2tfeaR+xm_B=_oJO8eWLyOjeXLm+8WSRSFSjkpUSQ@mail.gmail.com","threadId":"53160","inReplyTo":"xmqqo8s91ktt.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-04-03T06:01:34Z","receivedAt":"2020-04-03T06:01:50Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"I apologize. I did not notice that my patch was merged.\n\nRegards,\nShourya Shukla\n\n\nOn Fri, Apr 3, 2020 at 5:50 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Shourya Shukla <shouryashukla.oo@gmail.com> writes:\n>\n> > Subcommands in 'submodule--helper.c' which give a callback to other functions\n> > have structures and macros named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'\n> > respectively.\n> >\n> > The subcommand 'foreach' did not follow this convention and therefore had the naming of\n> > the form: 'struct foreach_cb' and 'CB_FOREACH_INIT'. Rename these to: 'struct foreach_cb'\n> > and 'FOREACH_CB_INIT' respectively.\n> >\n> >\n> > Shourya Shukla (1):\n> >   submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'\n> >\n> >  builtin/submodule--helper.c | 8 ++++----\n> >  1 file changed, 4 insertions(+), 4 deletions(-)\n>\n> Isn't this already in 'master'?\n>\n"},{"id":"394679","messageId":"xmqq1rp41mei.fsf@gitster.c.googlers.com","threadId":"53160","inReplyTo":"CAP6+3T2Kj2tfeaR+xm_B=_oJO8eWLyOjeXLm+8WSRSFSjkpUSQ@mail.gmail.com","subject":"Re: [PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-04-03T17:58:45Z","receivedAt":"2020-04-03T17:58:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shourya Shukla <shouryashukla.oo@gmail.com> writes:\n\n> I apologize. I did not notice that my patch was merged.\n\nNo need to be sorry ;-)  Thanks for contributing, and keep the good\npatches coming!\n"}]}