{"thread":{"id":"53017","subject":"[PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'","startedAt":"2020-03-18T09:59:00Z","lastAt":"2020-03-18T14:22:04Z","messageCount":5,"participants":["Shourya Shukla","Derrick Stolee"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"393385","messageId":"20200318095842.27679-1-shouryashukla.oo@gmail.com","threadId":"53017","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-03-18T09:58:41Z","receivedAt":"2020-03-18T09:59:00Z","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":"393386","messageId":"20200318095842.27679-2-shouryashukla.oo@gmail.com","threadId":"53017","inReplyTo":"20200318095842.27679-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-03-18T09:58:42Z","receivedAt":"2020-03-18T09:59:02Z","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 foreach_cb' to 'struct cb_foreach' 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 86a608eec1..1a4b391c88 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":"393389","messageId":"f6ea8357-a5c3-169c-b3c6-9d1726e65859@gmail.com","threadId":"53017","inReplyTo":"20200318095842.27679-2-shouryashukla.oo@gmail.com","subject":"Re: [PATCH 1/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2020-03-18T10:57:24Z","receivedAt":"2020-03-18T10:57:31Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 3/18/2020 5:58 AM, Shourya Shukla wrote:\n> In 'submodule--helper.c', the structures and macros for callbacks belonging\n> to any subcommand are named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'\n> respectively.\n> \n> This was an exception for the subcommand 'foreach' of the command\n> 'submodule'. Rename the aforementioned structures and macros:\n> 'struct foreach_cb' to 'struct cb_foreach' and 'CB_FOREACH_INIT'\n> to 'FOREACH_CB_INIT'.\n\nI believe your \"<before> to <after>\" statements are reversed.\n\n> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n> ---\n>  builtin/submodule--helper.c | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n> \n> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\n> index 86a608eec1..1a4b391c88 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\nBased on the description, I was worried this patch would be very large.\nThe fact that the change is so small makes this reasonable in isolation.\n\nThanks,\n-Stolee\n\n"},{"id":"393395","messageId":"20200318142024.16681-1-shouryashukla.oo@gmail.com","threadId":"53017","inReplyTo":"20200318095842.27679-1-shouryashukla.oo@gmail.com","subject":"[PATCH v2 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-03-18T14:20:23Z","receivedAt":"2020-03-18T14:22:02Z","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\nChanges in v2:\n\tReworded the commit message. The last statement was wrong.\n\tChanged it from: \n\t\"Rename the aforementioned structures and macros:\n\t'struct foreach_cb' to 'struct cb_foreach' and 'CB_FOREACH_INIT'\n\tto 'FOREACH_CB_INIT'.\"\n\t;to:\n\t\"Rename the aforementioned structures and macros:\n\t'struct cb_foreach' to 'struct foreach_cb' and 'CB_FOREACH_INIT'\n\tto 'FOREACH_CB_INIT'.\"\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":"393396","messageId":"20200318142024.16681-2-shouryashukla.oo@gmail.com","threadId":"53017","inReplyTo":"20200318142024.16681-1-shouryashukla.oo@gmail.com","subject":"[PATCH v2 1/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-03-18T14:20:24Z","receivedAt":"2020-03-18T14:22:04Z","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 86a608eec1..1a4b391c88 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"}]}