git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v11 28/40] builtin/apply: rename option parsing functions
@ 2016-08-11  8:52 Christian Couder
  2016-08-11  8:58 ` stefan.naewe
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Couder @ 2016-08-11  8:52 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Ævar Arnfjörð Bjarmason,
	Karsten Blees, Nguyen Thai Ngoc Duy, Stefan Beller, Eric Sunshine,
	Ramsay Jones, Johannes Sixt, René Scharfe, Christian Couder

As these functions are going to be part of the libified
apply api, let's give them a name that is more specific
to the apply API.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 builtin/apply.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/builtin/apply.c b/builtin/apply.c
index ad403f8..429fe44 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -4588,16 +4588,16 @@ static int apply_patch(struct apply_state *state,
 	return res;
 }
 
-static int option_parse_exclude(const struct option *opt,
-				const char *arg, int unset)
+static int apply_option_parse_exclude(const struct option *opt,
+				      const char *arg, int unset)
 {
 	struct apply_state *state = opt->value;
 	add_name_limit(state, arg, 1);
 	return 0;
 }
 
-static int option_parse_include(const struct option *opt,
-				const char *arg, int unset)
+static int apply_option_parse_include(const struct option *opt,
+				      const char *arg, int unset)
 {
 	struct apply_state *state = opt->value;
 	add_name_limit(state, arg, 0);
@@ -4605,9 +4605,9 @@ static int option_parse_include(const struct option *opt,
 	return 0;
 }
 
-static int option_parse_p(const struct option *opt,
-			  const char *arg,
-			  int unset)
+static int apply_option_parse_p(const struct option *opt,
+				const char *arg,
+				int unset)
 {
 	struct apply_state *state = opt->value;
 	state->p_value = atoi(arg);
@@ -4615,8 +4615,8 @@ static int option_parse_p(const struct option *opt,
 	return 0;
 }
 
-static int option_parse_space_change(const struct option *opt,
-				     const char *arg, int unset)
+static int apply_option_parse_space_change(const struct option *opt,
+					   const char *arg, int unset)
 {
 	struct apply_state *state = opt->value;
 	if (unset)
@@ -4626,8 +4626,8 @@ static int option_parse_space_change(const struct option *opt,
 	return 0;
 }
 
-static int option_parse_whitespace(const struct option *opt,
-				   const char *arg, int unset)
+static int apply_option_parse_whitespace(const struct option *opt,
+					 const char *arg, int unset)
 {
 	struct apply_state *state = opt->value;
 	state->whitespace_option = arg;
@@ -4636,8 +4636,8 @@ static int option_parse_whitespace(const struct option *opt,
 	return 0;
 }
 
-static int option_parse_directory(const struct option *opt,
-				  const char *arg, int unset)
+static int apply_option_parse_directory(const struct option *opt,
+					const char *arg, int unset)
 {
 	struct apply_state *state = opt->value;
 	strbuf_reset(&state->root);
@@ -4755,13 +4755,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
 	struct option builtin_apply_options[] = {
 		{ OPTION_CALLBACK, 0, "exclude", &state, N_("path"),
 			N_("don't apply changes matching the given path"),
-			0, option_parse_exclude },
+			0, apply_option_parse_exclude },
 		{ OPTION_CALLBACK, 0, "include", &state, N_("path"),
 			N_("apply changes matching the given path"),
-			0, option_parse_include },
+			0, apply_option_parse_include },
 		{ OPTION_CALLBACK, 'p', NULL, &state, N_("num"),
 			N_("remove <num> leading slashes from traditional diff paths"),
-			0, option_parse_p },
+			0, apply_option_parse_p },
 		OPT_BOOL(0, "no-add", &state.no_add,
 			N_("ignore additions made by the patch")),
 		OPT_BOOL(0, "stat", &state.diffstat,
@@ -4793,13 +4793,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
 				N_("ensure at least <n> lines of context match")),
 		{ OPTION_CALLBACK, 0, "whitespace", &state, N_("action"),
 			N_("detect new or modified lines that have whitespace errors"),
-			0, option_parse_whitespace },
+			0, apply_option_parse_whitespace },
 		{ OPTION_CALLBACK, 0, "ignore-space-change", &state, NULL,
 			N_("ignore changes in whitespace when finding context"),
-			PARSE_OPT_NOARG, option_parse_space_change },
+			PARSE_OPT_NOARG, apply_option_parse_space_change },
 		{ OPTION_CALLBACK, 0, "ignore-whitespace", &state, NULL,
 			N_("ignore changes in whitespace when finding context"),
-			PARSE_OPT_NOARG, option_parse_space_change },
+			PARSE_OPT_NOARG, apply_option_parse_space_change },
 		OPT_BOOL('R', "reverse", &state.apply_in_reverse,
 			N_("apply the patch in reverse")),
 		OPT_BOOL(0, "unidiff-zero", &state.unidiff_zero,
@@ -4817,7 +4817,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
 			RECOUNT),
 		{ OPTION_CALLBACK, 0, "directory", &state, N_("root"),
 			N_("prepend <root> to all filenames"),
-			0, option_parse_directory },
+			0, apply_option_parse_directory },
 		OPT_END()
 	};
 
-- 
2.9.2.614.g5428e0c


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

* Re: [PATCH v11 28/40] builtin/apply: rename option parsing functions
  2016-08-11  8:52 [PATCH v11 28/40] builtin/apply: rename option parsing functions Christian Couder
@ 2016-08-11  8:58 ` stefan.naewe
  2016-08-11 17:49   ` Christian Couder
  0 siblings, 1 reply; 3+ messages in thread
From: stefan.naewe @ 2016-08-11  8:58 UTC (permalink / raw)
  To: christian.couder, git
  Cc: gitster, peff, avarab, karsten.blees, pclouds, sbeller, sunshine,
	ramsay, j6t, l.s.r, chriscool

Am 11.08.2016 um 10:52 schrieb Christian Couder:
> As these functions are going to be part of the libified
> apply api, let's give them a name that is more specific

s/api/API/

;-)

> to the apply API.
> 
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
>  builtin/apply.c | 40 ++++++++++++++++++++--------------------
>  1 file changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/builtin/apply.c b/builtin/apply.c
> index ad403f8..429fe44 100644
> --- a/builtin/apply.c
> +++ b/builtin/apply.c
> @@ -4588,16 +4588,16 @@ static int apply_patch(struct apply_state *state,
>  	return res;
>  }
>  
> -static int option_parse_exclude(const struct option *opt,
> -				const char *arg, int unset)
> +static int apply_option_parse_exclude(const struct option *opt,
> +				      const char *arg, int unset)
>  {
>  	struct apply_state *state = opt->value;
>  	add_name_limit(state, arg, 1);
>  	return 0;
>  }
>  
> -static int option_parse_include(const struct option *opt,
> -				const char *arg, int unset)
> +static int apply_option_parse_include(const struct option *opt,
> +				      const char *arg, int unset)
>  {
>  	struct apply_state *state = opt->value;
>  	add_name_limit(state, arg, 0);
> @@ -4605,9 +4605,9 @@ static int option_parse_include(const struct option *opt,
>  	return 0;
>  }
>  
> -static int option_parse_p(const struct option *opt,
> -			  const char *arg,
> -			  int unset)
> +static int apply_option_parse_p(const struct option *opt,
> +				const char *arg,
> +				int unset)
>  {
>  	struct apply_state *state = opt->value;
>  	state->p_value = atoi(arg);
> @@ -4615,8 +4615,8 @@ static int option_parse_p(const struct option *opt,
>  	return 0;
>  }
>  
> -static int option_parse_space_change(const struct option *opt,
> -				     const char *arg, int unset)
> +static int apply_option_parse_space_change(const struct option *opt,
> +					   const char *arg, int unset)
>  {
>  	struct apply_state *state = opt->value;
>  	if (unset)
> @@ -4626,8 +4626,8 @@ static int option_parse_space_change(const struct option *opt,
>  	return 0;
>  }
>  
> -static int option_parse_whitespace(const struct option *opt,
> -				   const char *arg, int unset)
> +static int apply_option_parse_whitespace(const struct option *opt,
> +					 const char *arg, int unset)
>  {
>  	struct apply_state *state = opt->value;
>  	state->whitespace_option = arg;
> @@ -4636,8 +4636,8 @@ static int option_parse_whitespace(const struct option *opt,
>  	return 0;
>  }
>  
> -static int option_parse_directory(const struct option *opt,
> -				  const char *arg, int unset)
> +static int apply_option_parse_directory(const struct option *opt,
> +					const char *arg, int unset)
>  {
>  	struct apply_state *state = opt->value;
>  	strbuf_reset(&state->root);
> @@ -4755,13 +4755,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
>  	struct option builtin_apply_options[] = {
>  		{ OPTION_CALLBACK, 0, "exclude", &state, N_("path"),
>  			N_("don't apply changes matching the given path"),
> -			0, option_parse_exclude },
> +			0, apply_option_parse_exclude },
>  		{ OPTION_CALLBACK, 0, "include", &state, N_("path"),
>  			N_("apply changes matching the given path"),
> -			0, option_parse_include },
> +			0, apply_option_parse_include },
>  		{ OPTION_CALLBACK, 'p', NULL, &state, N_("num"),
>  			N_("remove <num> leading slashes from traditional diff paths"),
> -			0, option_parse_p },
> +			0, apply_option_parse_p },
>  		OPT_BOOL(0, "no-add", &state.no_add,
>  			N_("ignore additions made by the patch")),
>  		OPT_BOOL(0, "stat", &state.diffstat,
> @@ -4793,13 +4793,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
>  				N_("ensure at least <n> lines of context match")),
>  		{ OPTION_CALLBACK, 0, "whitespace", &state, N_("action"),
>  			N_("detect new or modified lines that have whitespace errors"),
> -			0, option_parse_whitespace },
> +			0, apply_option_parse_whitespace },
>  		{ OPTION_CALLBACK, 0, "ignore-space-change", &state, NULL,
>  			N_("ignore changes in whitespace when finding context"),
> -			PARSE_OPT_NOARG, option_parse_space_change },
> +			PARSE_OPT_NOARG, apply_option_parse_space_change },
>  		{ OPTION_CALLBACK, 0, "ignore-whitespace", &state, NULL,
>  			N_("ignore changes in whitespace when finding context"),
> -			PARSE_OPT_NOARG, option_parse_space_change },
> +			PARSE_OPT_NOARG, apply_option_parse_space_change },
>  		OPT_BOOL('R', "reverse", &state.apply_in_reverse,
>  			N_("apply the patch in reverse")),
>  		OPT_BOOL(0, "unidiff-zero", &state.unidiff_zero,
> @@ -4817,7 +4817,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
>  			RECOUNT),
>  		{ OPTION_CALLBACK, 0, "directory", &state, N_("root"),
>  			N_("prepend <root> to all filenames"),
> -			0, option_parse_directory },
> +			0, apply_option_parse_directory },
>  		OPT_END()
>  	};
>  
> 


-- 
----------------------------------------------------------------
/dev/random says: Tis better to have loved and lost than just to have lost.
python -c "print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')" 
GPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9  9666 829B 49C5 9221 27AF

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

* Re: [PATCH v11 28/40] builtin/apply: rename option parsing functions
  2016-08-11  8:58 ` stefan.naewe
@ 2016-08-11 17:49   ` Christian Couder
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Couder @ 2016-08-11 17:49 UTC (permalink / raw)
  To: stefan.naewe
  Cc: git, Junio C Hamano, Jeff King,
	Ævar Arnfjörð Bjarmason, Karsten Blees,
	Nguyen Thai Ngoc Duy, Stefan Beller, Eric Sunshine, Ramsay Jones,
	Johannes Sixt, l.s.r@web.de, Christian Couder

On Thu, Aug 11, 2016 at 10:58 AM,  <stefan.naewe@atlas-elektronik.com> wrote:
> Am 11.08.2016 um 10:52 schrieb Christian Couder:
>> As these functions are going to be part of the libified
>> apply api, let's give them a name that is more specific
>
> s/api/API/
>
> ;-)

Ooops.
Anyway as this is patch 28/40 and the other problem you found is in
40/40, I will just resend patches from 28/40 to 40/40 in v12 (so only
the last 13 patches, that I will call part 3 of the whole series).

Thanks.

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

end of thread, other threads:[~2016-08-11 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-11  8:52 [PATCH v11 28/40] builtin/apply: rename option parsing functions Christian Couder
2016-08-11  8:58 ` stefan.naewe
2016-08-11 17:49   ` Christian Couder

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).