git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'
@ 2020-03-18  9:58 Shourya Shukla
  2020-03-18  9:58 ` [PATCH 1/1] " Shourya Shukla
  2020-03-18 14:20 ` [PATCH v2 0/1] " Shourya Shukla
  0 siblings, 2 replies; 9+ messages in thread
From: Shourya Shukla @ 2020-03-18  9:58 UTC (permalink / raw)
  To: git; +Cc: Shourya Shukla

Subcommands in 'submodule--helper.c' which give a callback to other functions
have structures and macros named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'
respectively.

The subcommand 'foreach' did not follow this convention and therefore had the naming of
the form: 'struct foreach_cb' and 'CB_FOREACH_INIT'. Rename these to: 'struct foreach_cb'
and 'FOREACH_CB_INIT' respectively.


Shourya Shukla (1):
  submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'

 builtin/submodule--helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.20.1


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

* [PATCH 1/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'
  2020-03-18  9:58 [PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb' Shourya Shukla
@ 2020-03-18  9:58 ` Shourya Shukla
  2020-03-18 10:57   ` Derrick Stolee
  2020-03-18 14:20 ` [PATCH v2 0/1] " Shourya Shukla
  1 sibling, 1 reply; 9+ messages in thread
From: Shourya Shukla @ 2020-03-18  9:58 UTC (permalink / raw)
  To: git; +Cc: Shourya Shukla

In 'submodule--helper.c', the structures and macros for callbacks belonging
to any subcommand are named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'
respectively.

This was an exception for the subcommand 'foreach' of the command
'submodule'. Rename the aforementioned structures and macros:
'struct foreach_cb' to 'struct cb_foreach' and 'CB_FOREACH_INIT'
to 'FOREACH_CB_INIT'.

Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
---
 builtin/submodule--helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 86a608eec1..1a4b391c88 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -444,19 +444,19 @@ static void for_each_listed_submodule(const struct module_list *list,
 		fn(list->entries[i], cb_data);
 }
 
-struct cb_foreach {
+struct foreach_cb {
 	int argc;
 	const char **argv;
 	const char *prefix;
 	int quiet;
 	int recursive;
 };
-#define CB_FOREACH_INIT { 0 }
+#define FOREACH_CB_INIT { 0 }
 
 static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 				       void *cb_data)
 {
-	struct cb_foreach *info = cb_data;
+	struct foreach_cb *info = cb_data;
 	const char *path = list_item->name;
 	const struct object_id *ce_oid = &list_item->oid;
 
@@ -557,7 +557,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 
 static int module_foreach(int argc, const char **argv, const char *prefix)
 {
-	struct cb_foreach info = CB_FOREACH_INIT;
+	struct foreach_cb info = FOREACH_CB_INIT;
 	struct pathspec pathspec;
 	struct module_list list = MODULE_LIST_INIT;
 
-- 
2.20.1


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

* Re: [PATCH 1/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'
  2020-03-18  9:58 ` [PATCH 1/1] " Shourya Shukla
@ 2020-03-18 10:57   ` Derrick Stolee
  0 siblings, 0 replies; 9+ messages in thread
From: Derrick Stolee @ 2020-03-18 10:57 UTC (permalink / raw)
  To: Shourya Shukla, git

On 3/18/2020 5:58 AM, Shourya Shukla wrote:
> In 'submodule--helper.c', the structures and macros for callbacks belonging
> to any subcommand are named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'
> respectively.
> 
> This was an exception for the subcommand 'foreach' of the command
> 'submodule'. Rename the aforementioned structures and macros:
> 'struct foreach_cb' to 'struct cb_foreach' and 'CB_FOREACH_INIT'
> to 'FOREACH_CB_INIT'.

I believe your "<before> to <after>" statements are reversed.

> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
> ---
>  builtin/submodule--helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index 86a608eec1..1a4b391c88 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -444,19 +444,19 @@ static void for_each_listed_submodule(const struct module_list *list,
>  		fn(list->entries[i], cb_data);
>  }
>  
> -struct cb_foreach {
> +struct foreach_cb {
>  	int argc;
>  	const char **argv;
>  	const char *prefix;
>  	int quiet;
>  	int recursive;
>  };
> -#define CB_FOREACH_INIT { 0 }
> +#define FOREACH_CB_INIT { 0 }
>  
>  static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
>  				       void *cb_data)
>  {
> -	struct cb_foreach *info = cb_data;
> +	struct foreach_cb *info = cb_data;
>  	const char *path = list_item->name;
>  	const struct object_id *ce_oid = &list_item->oid;
>  
> @@ -557,7 +557,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
>  
>  static int module_foreach(int argc, const char **argv, const char *prefix)
>  {
> -	struct cb_foreach info = CB_FOREACH_INIT;
> +	struct foreach_cb info = FOREACH_CB_INIT;
>  	struct pathspec pathspec;
>  	struct module_list list = MODULE_LIST_INIT;

Based on the description, I was worried this patch would be very large.
The fact that the change is so small makes this reasonable in isolation.

Thanks,
-Stolee


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

* [PATCH v2 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'
  2020-03-18  9:58 [PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb' Shourya Shukla
  2020-03-18  9:58 ` [PATCH 1/1] " Shourya Shukla
@ 2020-03-18 14:20 ` Shourya Shukla
  2020-03-18 14:20   ` [PATCH v2 1/1] " Shourya Shukla
  1 sibling, 1 reply; 9+ messages in thread
From: Shourya Shukla @ 2020-03-18 14:20 UTC (permalink / raw)
  To: git; +Cc: Shourya Shukla

Subcommands in 'submodule--helper.c' which give a callback to other functions
have structures and macros named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'
respectively.

The subcommand 'foreach' did not follow this convention and therefore had the naming of
the form: 'struct foreach_cb' and 'CB_FOREACH_INIT'. Rename these to: 'struct foreach_cb'
and 'FOREACH_CB_INIT' respectively.


Changes in v2:
	Reworded the commit message. The last statement was wrong.
	Changed it from: 
	"Rename the aforementioned structures and macros:
	'struct foreach_cb' to 'struct cb_foreach' and 'CB_FOREACH_INIT'
	to 'FOREACH_CB_INIT'."
	;to:
	"Rename the aforementioned structures and macros:
	'struct cb_foreach' to 'struct foreach_cb' and 'CB_FOREACH_INIT'
	to 'FOREACH_CB_INIT'."


Shourya Shukla (1):
  submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'

 builtin/submodule--helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.20.1


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

* [PATCH v2 1/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'
  2020-03-18 14:20 ` [PATCH v2 0/1] " Shourya Shukla
@ 2020-03-18 14:20   ` Shourya Shukla
  0 siblings, 0 replies; 9+ messages in thread
From: Shourya Shukla @ 2020-03-18 14:20 UTC (permalink / raw)
  To: git; +Cc: Shourya Shukla

In 'submodule--helper.c', the structures and macros for callbacks belonging
to any subcommand are named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'
respectively.

This was an exception for the subcommand 'foreach' of the command
'submodule'. Rename the aforementioned structures and macros:
'struct cb_foreach' to 'struct foreach_cb' and 'CB_FOREACH_INIT'
to 'FOREACH_CB_INIT'.

Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
---
 builtin/submodule--helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 86a608eec1..1a4b391c88 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -444,19 +444,19 @@ static void for_each_listed_submodule(const struct module_list *list,
 		fn(list->entries[i], cb_data);
 }
 
-struct cb_foreach {
+struct foreach_cb {
 	int argc;
 	const char **argv;
 	const char *prefix;
 	int quiet;
 	int recursive;
 };
-#define CB_FOREACH_INIT { 0 }
+#define FOREACH_CB_INIT { 0 }
 
 static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 				       void *cb_data)
 {
-	struct cb_foreach *info = cb_data;
+	struct foreach_cb *info = cb_data;
 	const char *path = list_item->name;
 	const struct object_id *ce_oid = &list_item->oid;
 
@@ -557,7 +557,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
 
 static int module_foreach(int argc, const char **argv, const char *prefix)
 {
-	struct cb_foreach info = CB_FOREACH_INIT;
+	struct foreach_cb info = FOREACH_CB_INIT;
 	struct pathspec pathspec;
 	struct module_list list = MODULE_LIST_INIT;
 
-- 
2.20.1


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

* Re: [PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'
  2020-04-03  6:01   ` Shourya Shukla
@ 2020-04-03 17:58     ` Junio C Hamano
  0 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2020-04-03 17:58 UTC (permalink / raw)
  To: Shourya Shukla; +Cc: git

Shourya Shukla <shouryashukla.oo@gmail.com> writes:

> I apologize. I did not notice that my patch was merged.

No need to be sorry ;-)  Thanks for contributing, and keep the good
patches coming!

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

* Re: [PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'
  2020-04-03  0:20 ` Junio C Hamano
@ 2020-04-03  6:01   ` Shourya Shukla
  2020-04-03 17:58     ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Shourya Shukla @ 2020-04-03  6:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

I apologize. I did not notice that my patch was merged.

Regards,
Shourya Shukla


On Fri, Apr 3, 2020 at 5:50 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Shourya Shukla <shouryashukla.oo@gmail.com> writes:
>
> > Subcommands in 'submodule--helper.c' which give a callback to other functions
> > have structures and macros named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'
> > respectively.
> >
> > The subcommand 'foreach' did not follow this convention and therefore had the naming of
> > the form: 'struct foreach_cb' and 'CB_FOREACH_INIT'. Rename these to: 'struct foreach_cb'
> > and 'FOREACH_CB_INIT' respectively.
> >
> >
> > Shourya Shukla (1):
> >   submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'
> >
> >  builtin/submodule--helper.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
>
> Isn't this already in 'master'?
>

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

* Re: [PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'
  2020-04-02 22:58 [PATCH 0/1] " Shourya Shukla
@ 2020-04-03  0:20 ` Junio C Hamano
  2020-04-03  6:01   ` Shourya Shukla
  0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2020-04-03  0:20 UTC (permalink / raw)
  To: Shourya Shukla; +Cc: git

Shourya Shukla <shouryashukla.oo@gmail.com> writes:

> Subcommands in 'submodule--helper.c' which give a callback to other functions
> have structures and macros named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'
> respectively.
>
> The subcommand 'foreach' did not follow this convention and therefore had the naming of
> the form: 'struct foreach_cb' and 'CB_FOREACH_INIT'. Rename these to: 'struct foreach_cb'
> and 'FOREACH_CB_INIT' respectively.
>
>
> Shourya Shukla (1):
>   submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'
>
>  builtin/submodule--helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Isn't this already in 'master'?


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

* [PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'
@ 2020-04-02 22:58 Shourya Shukla
  2020-04-03  0:20 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Shourya Shukla @ 2020-04-02 22:58 UTC (permalink / raw)
  To: git; +Cc: Shourya Shukla

Subcommands in 'submodule--helper.c' which give a callback to other functions
have structures and macros named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT'
respectively.

The subcommand 'foreach' did not follow this convention and therefore had the naming of
the form: 'struct foreach_cb' and 'CB_FOREACH_INIT'. Rename these to: 'struct foreach_cb'
and 'FOREACH_CB_INIT' respectively.


Shourya Shukla (1):
  submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'

 builtin/submodule--helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2020-04-03 17:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18  9:58 [PATCH 0/1] submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb' Shourya Shukla
2020-03-18  9:58 ` [PATCH 1/1] " Shourya Shukla
2020-03-18 10:57   ` Derrick Stolee
2020-03-18 14:20 ` [PATCH v2 0/1] " Shourya Shukla
2020-03-18 14:20   ` [PATCH v2 1/1] " Shourya Shukla
2020-04-02 22:58 [PATCH 0/1] " Shourya Shukla
2020-04-03  0:20 ` Junio C Hamano
2020-04-03  6:01   ` Shourya Shukla
2020-04-03 17:58     ` Junio C Hamano

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).