Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin/apply: rename option parsing functions
author
Christian Couder
<christian.couder@gmail.com>
Sun, 4 Sep 2016 20:18:20 +0000
(22:18 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 7 Sep 2016 19:29:53 +0000
(12:29 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/apply.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
603752a
)
diff --git
a/builtin/apply.c
b/builtin/apply.c
index 5cd7fd8223a8a2aefefe957c23f09e3e8a5fd107..1f56303204e0fed40b5ffa39da6c2c72b514d01d 100644
(file)
--- a/
builtin/apply.c
+++ b/
builtin/apply.c
@@
-4588,16
+4588,16
@@
static int apply_patch(struct apply_state *state,
return res;
}
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;
}
{
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);
{
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;
}
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);
{
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;
}
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)
{
struct apply_state *state = opt->value;
if (unset)
@@
-4626,8
+4626,8
@@
static int option_parse_space_change(const struct option *opt,
return 0;
}
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;
{
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;
}
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);
{
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"),
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"),
{ 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"),
{ 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,
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"),
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"),
{ 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"),
{ 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,
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"),
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()
};
OPT_END()
};