{"thread":{"id":"43055","subject":"[PATCH v11 28/40] builtin/apply: rename option parsing functions","startedAt":"2016-08-11T08:53:13Z","lastAt":"2016-08-11T17:49:10Z","messageCount":3,"participants":["Christian Couder","stefan.naewe@atlas-elektronik.com"],"isPatch":true,"patchVersion":11,"patchTotal":40},"messages":[{"id":"293700","messageId":"20160811085253.19086-1-chriscool@tuxfamily.org","threadId":"43055","inReplyTo":null,"subject":"[PATCH v11 28/40] builtin/apply: rename option parsing functions","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2016-08-11T08:52:53Z","receivedAt":"2016-08-11T08:53:13Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"As these functions are going to be part of the libified\napply api, let's give them a name that is more specific\nto the apply API.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/apply.c | 40 ++++++++++++++++++++--------------------\n 1 file changed, 20 insertions(+), 20 deletions(-)\n\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex ad403f8..429fe44 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -4588,16 +4588,16 @@ static int apply_patch(struct apply_state *state,\n \treturn res;\n }\n \n-static int option_parse_exclude(const struct option *opt,\n-\t\t\t\tconst char *arg, int unset)\n+static int apply_option_parse_exclude(const struct option *opt,\n+\t\t\t\t      const char *arg, int unset)\n {\n \tstruct apply_state *state = opt->value;\n \tadd_name_limit(state, arg, 1);\n \treturn 0;\n }\n \n-static int option_parse_include(const struct option *opt,\n-\t\t\t\tconst char *arg, int unset)\n+static int apply_option_parse_include(const struct option *opt,\n+\t\t\t\t      const char *arg, int unset)\n {\n \tstruct apply_state *state = opt->value;\n \tadd_name_limit(state, arg, 0);\n@@ -4605,9 +4605,9 @@ static int option_parse_include(const struct option *opt,\n \treturn 0;\n }\n \n-static int option_parse_p(const struct option *opt,\n-\t\t\t  const char *arg,\n-\t\t\t  int unset)\n+static int apply_option_parse_p(const struct option *opt,\n+\t\t\t\tconst char *arg,\n+\t\t\t\tint unset)\n {\n \tstruct apply_state *state = opt->value;\n \tstate->p_value = atoi(arg);\n@@ -4615,8 +4615,8 @@ static int option_parse_p(const struct option *opt,\n \treturn 0;\n }\n \n-static int option_parse_space_change(const struct option *opt,\n-\t\t\t\t     const char *arg, int unset)\n+static int apply_option_parse_space_change(const struct option *opt,\n+\t\t\t\t\t   const char *arg, int unset)\n {\n \tstruct apply_state *state = opt->value;\n \tif (unset)\n@@ -4626,8 +4626,8 @@ static int option_parse_space_change(const struct option *opt,\n \treturn 0;\n }\n \n-static int option_parse_whitespace(const struct option *opt,\n-\t\t\t\t   const char *arg, int unset)\n+static int apply_option_parse_whitespace(const struct option *opt,\n+\t\t\t\t\t const char *arg, int unset)\n {\n \tstruct apply_state *state = opt->value;\n \tstate->whitespace_option = arg;\n@@ -4636,8 +4636,8 @@ static int option_parse_whitespace(const struct option *opt,\n \treturn 0;\n }\n \n-static int option_parse_directory(const struct option *opt,\n-\t\t\t\t  const char *arg, int unset)\n+static int apply_option_parse_directory(const struct option *opt,\n+\t\t\t\t\tconst char *arg, int unset)\n {\n \tstruct apply_state *state = opt->value;\n \tstrbuf_reset(&state->root);\n@@ -4755,13 +4755,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)\n \tstruct option builtin_apply_options[] = {\n \t\t{ OPTION_CALLBACK, 0, \"exclude\", &state, N_(\"path\"),\n \t\t\tN_(\"don't apply changes matching the given path\"),\n-\t\t\t0, option_parse_exclude },\n+\t\t\t0, apply_option_parse_exclude },\n \t\t{ OPTION_CALLBACK, 0, \"include\", &state, N_(\"path\"),\n \t\t\tN_(\"apply changes matching the given path\"),\n-\t\t\t0, option_parse_include },\n+\t\t\t0, apply_option_parse_include },\n \t\t{ OPTION_CALLBACK, 'p', NULL, &state, N_(\"num\"),\n \t\t\tN_(\"remove <num> leading slashes from traditional diff paths\"),\n-\t\t\t0, option_parse_p },\n+\t\t\t0, apply_option_parse_p },\n \t\tOPT_BOOL(0, \"no-add\", &state.no_add,\n \t\t\tN_(\"ignore additions made by the patch\")),\n \t\tOPT_BOOL(0, \"stat\", &state.diffstat,\n@@ -4793,13 +4793,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)\n \t\t\t\tN_(\"ensure at least <n> lines of context match\")),\n \t\t{ OPTION_CALLBACK, 0, \"whitespace\", &state, N_(\"action\"),\n \t\t\tN_(\"detect new or modified lines that have whitespace errors\"),\n-\t\t\t0, option_parse_whitespace },\n+\t\t\t0, apply_option_parse_whitespace },\n \t\t{ OPTION_CALLBACK, 0, \"ignore-space-change\", &state, NULL,\n \t\t\tN_(\"ignore changes in whitespace when finding context\"),\n-\t\t\tPARSE_OPT_NOARG, option_parse_space_change },\n+\t\t\tPARSE_OPT_NOARG, apply_option_parse_space_change },\n \t\t{ OPTION_CALLBACK, 0, \"ignore-whitespace\", &state, NULL,\n \t\t\tN_(\"ignore changes in whitespace when finding context\"),\n-\t\t\tPARSE_OPT_NOARG, option_parse_space_change },\n+\t\t\tPARSE_OPT_NOARG, apply_option_parse_space_change },\n \t\tOPT_BOOL('R', \"reverse\", &state.apply_in_reverse,\n \t\t\tN_(\"apply the patch in reverse\")),\n \t\tOPT_BOOL(0, \"unidiff-zero\", &state.unidiff_zero,\n@@ -4817,7 +4817,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix)\n \t\t\tRECOUNT),\n \t\t{ OPTION_CALLBACK, 0, \"directory\", &state, N_(\"root\"),\n \t\t\tN_(\"prepend <root> to all filenames\"),\n-\t\t\t0, option_parse_directory },\n+\t\t\t0, apply_option_parse_directory },\n \t\tOPT_END()\n \t};\n \n-- \n2.9.2.614.g5428e0c\n\n"},{"id":"293703","messageId":"126f7789-c2c8-669f-2210-eb6864f8f6da@atlas-elektronik.com","threadId":"43055","inReplyTo":"20160811085253.19086-1-chriscool@tuxfamily.org","subject":"Re: [PATCH v11 28/40] builtin/apply: rename option parsing functions","fromName":"","fromEmail":"stefan.naewe@atlas-elektronik.com","sentAt":"2016-08-11T08:58:43Z","receivedAt":"2016-08-11T09:00:43Z","isPatch":true,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"Am 11.08.2016 um 10:52 schrieb Christian Couder:\n> As these functions are going to be part of the libified\n> apply api, let's give them a name that is more specific\n\ns/api/API/\n\n;-)\n\n> to the apply API.\n> \n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  builtin/apply.c | 40 ++++++++++++++++++++--------------------\n>  1 file changed, 20 insertions(+), 20 deletions(-)\n> \n> diff --git a/builtin/apply.c b/builtin/apply.c\n> index ad403f8..429fe44 100644\n> --- a/builtin/apply.c\n> +++ b/builtin/apply.c\n> @@ -4588,16 +4588,16 @@ static int apply_patch(struct apply_state *state,\n>  \treturn res;\n>  }\n>  \n> -static int option_parse_exclude(const struct option *opt,\n> -\t\t\t\tconst char *arg, int unset)\n> +static int apply_option_parse_exclude(const struct option *opt,\n> +\t\t\t\t      const char *arg, int unset)\n>  {\n>  \tstruct apply_state *state = opt->value;\n>  \tadd_name_limit(state, arg, 1);\n>  \treturn 0;\n>  }\n>  \n> -static int option_parse_include(const struct option *opt,\n> -\t\t\t\tconst char *arg, int unset)\n> +static int apply_option_parse_include(const struct option *opt,\n> +\t\t\t\t      const char *arg, int unset)\n>  {\n>  \tstruct apply_state *state = opt->value;\n>  \tadd_name_limit(state, arg, 0);\n> @@ -4605,9 +4605,9 @@ static int option_parse_include(const struct option *opt,\n>  \treturn 0;\n>  }\n>  \n> -static int option_parse_p(const struct option *opt,\n> -\t\t\t  const char *arg,\n> -\t\t\t  int unset)\n> +static int apply_option_parse_p(const struct option *opt,\n> +\t\t\t\tconst char *arg,\n> +\t\t\t\tint unset)\n>  {\n>  \tstruct apply_state *state = opt->value;\n>  \tstate->p_value = atoi(arg);\n> @@ -4615,8 +4615,8 @@ static int option_parse_p(const struct option *opt,\n>  \treturn 0;\n>  }\n>  \n> -static int option_parse_space_change(const struct option *opt,\n> -\t\t\t\t     const char *arg, int unset)\n> +static int apply_option_parse_space_change(const struct option *opt,\n> +\t\t\t\t\t   const char *arg, int unset)\n>  {\n>  \tstruct apply_state *state = opt->value;\n>  \tif (unset)\n> @@ -4626,8 +4626,8 @@ static int option_parse_space_change(const struct option *opt,\n>  \treturn 0;\n>  }\n>  \n> -static int option_parse_whitespace(const struct option *opt,\n> -\t\t\t\t   const char *arg, int unset)\n> +static int apply_option_parse_whitespace(const struct option *opt,\n> +\t\t\t\t\t const char *arg, int unset)\n>  {\n>  \tstruct apply_state *state = opt->value;\n>  \tstate->whitespace_option = arg;\n> @@ -4636,8 +4636,8 @@ static int option_parse_whitespace(const struct option *opt,\n>  \treturn 0;\n>  }\n>  \n> -static int option_parse_directory(const struct option *opt,\n> -\t\t\t\t  const char *arg, int unset)\n> +static int apply_option_parse_directory(const struct option *opt,\n> +\t\t\t\t\tconst char *arg, int unset)\n>  {\n>  \tstruct apply_state *state = opt->value;\n>  \tstrbuf_reset(&state->root);\n> @@ -4755,13 +4755,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)\n>  \tstruct option builtin_apply_options[] = {\n>  \t\t{ OPTION_CALLBACK, 0, \"exclude\", &state, N_(\"path\"),\n>  \t\t\tN_(\"don't apply changes matching the given path\"),\n> -\t\t\t0, option_parse_exclude },\n> +\t\t\t0, apply_option_parse_exclude },\n>  \t\t{ OPTION_CALLBACK, 0, \"include\", &state, N_(\"path\"),\n>  \t\t\tN_(\"apply changes matching the given path\"),\n> -\t\t\t0, option_parse_include },\n> +\t\t\t0, apply_option_parse_include },\n>  \t\t{ OPTION_CALLBACK, 'p', NULL, &state, N_(\"num\"),\n>  \t\t\tN_(\"remove <num> leading slashes from traditional diff paths\"),\n> -\t\t\t0, option_parse_p },\n> +\t\t\t0, apply_option_parse_p },\n>  \t\tOPT_BOOL(0, \"no-add\", &state.no_add,\n>  \t\t\tN_(\"ignore additions made by the patch\")),\n>  \t\tOPT_BOOL(0, \"stat\", &state.diffstat,\n> @@ -4793,13 +4793,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)\n>  \t\t\t\tN_(\"ensure at least <n> lines of context match\")),\n>  \t\t{ OPTION_CALLBACK, 0, \"whitespace\", &state, N_(\"action\"),\n>  \t\t\tN_(\"detect new or modified lines that have whitespace errors\"),\n> -\t\t\t0, option_parse_whitespace },\n> +\t\t\t0, apply_option_parse_whitespace },\n>  \t\t{ OPTION_CALLBACK, 0, \"ignore-space-change\", &state, NULL,\n>  \t\t\tN_(\"ignore changes in whitespace when finding context\"),\n> -\t\t\tPARSE_OPT_NOARG, option_parse_space_change },\n> +\t\t\tPARSE_OPT_NOARG, apply_option_parse_space_change },\n>  \t\t{ OPTION_CALLBACK, 0, \"ignore-whitespace\", &state, NULL,\n>  \t\t\tN_(\"ignore changes in whitespace when finding context\"),\n> -\t\t\tPARSE_OPT_NOARG, option_parse_space_change },\n> +\t\t\tPARSE_OPT_NOARG, apply_option_parse_space_change },\n>  \t\tOPT_BOOL('R', \"reverse\", &state.apply_in_reverse,\n>  \t\t\tN_(\"apply the patch in reverse\")),\n>  \t\tOPT_BOOL(0, \"unidiff-zero\", &state.unidiff_zero,\n> @@ -4817,7 +4817,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix)\n>  \t\t\tRECOUNT),\n>  \t\t{ OPTION_CALLBACK, 0, \"directory\", &state, N_(\"root\"),\n>  \t\t\tN_(\"prepend <root> to all filenames\"),\n> -\t\t\t0, option_parse_directory },\n> +\t\t\t0, apply_option_parse_directory },\n>  \t\tOPT_END()\n>  \t};\n>  \n> \n\n\n-- \n----------------------------------------------------------------\n/dev/random says: Tis better to have loved and lost than just to have lost.\npython -c \"print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')\" \nGPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9  9666 829B 49C5 9221 27AF"},{"id":"293768","messageId":"CAP8UFD0msQJT2YaQHtHKwhbGo4ujO6ectfKuKKed_yda909TiA@mail.gmail.com","threadId":"43055","inReplyTo":"126f7789-c2c8-669f-2210-eb6864f8f6da@atlas-elektronik.com","subject":"Re: [PATCH v11 28/40] builtin/apply: rename option parsing functions","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2016-08-11T17:49:03Z","receivedAt":"2016-08-11T17:49:10Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Thu, Aug 11, 2016 at 10:58 AM,  <stefan.naewe@atlas-elektronik.com> wrote:\n> Am 11.08.2016 um 10:52 schrieb Christian Couder:\n>> As these functions are going to be part of the libified\n>> apply api, let's give them a name that is more specific\n>\n> s/api/API/\n>\n> ;-)\n\nOoops.\nAnyway as this is patch 28/40 and the other problem you found is in\n40/40, I will just resend patches from 28/40 to 40/40 in v12 (so only\nthe last 13 patches, that I will call part 3 of the whole series).\n\nThanks.\n"}]}