@@ -11,7 +11,8 @@ struct config_alias_data {
struct string_list *list;
};
-static int config_alias_cb(const char *key, const char *value, void *d)
+static int config_alias_cb(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *d)
{
struct config_alias_data *data = d;
const char *p;
@@ -410,7 +410,8 @@ static int tar_filter_config(const char *var, const char *value,
return 0;
}
-static int git_tar_config(const char *var, const char *value, void *cb)
+static int git_tar_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *cb)
{
if (!strcmp(var, "tar.umask")) {
if (value && !strcmp(value, "user")) {
@@ -616,6 +616,7 @@ static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)
}
static int archive_zip_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *data UNUSED)
{
return userdiff_config(var, value);
@@ -355,7 +355,8 @@ static struct option builtin_add_options[] = {
OPT_END(),
};
-static int add_config(const char *var, const char *value, void *cb)
+static int add_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "add.ignoreerrors") ||
!strcmp(var, "add.ignore-errors")) {
@@ -363,7 +364,7 @@ static int add_config(const char *var, const char *value, void *cb)
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static const char embedded_advice[] = N_(
@@ -692,7 +692,8 @@ static const char *add_prefix(const char *prefix, const char *path)
return prefix_path(prefix, prefix ? strlen(prefix) : 0, path);
}
-static int git_blame_config(const char *var, const char *value, void *cb)
+static int git_blame_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "blame.showroot")) {
show_root = git_config_bool(var, value);
@@ -765,7 +766,7 @@ static int git_blame_config(const char *var, const char *value, void *cb)
if (userdiff_config(var, value) < 0)
return -1;
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static int blame_copy_callback(const struct option *option, const char *arg, int unset)
@@ -80,7 +80,8 @@ static unsigned int colopts;
define_list_config_array(color_branch_slots);
-static int git_branch_config(const char *var, const char *value, void *cb)
+static int git_branch_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
const char *slot_name;
@@ -117,7 +118,7 @@ static int git_branch_config(const char *var, const char *value, void *cb)
if (git_color_config(var, value, cb) < 0)
return -1;
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static const char *branch_get_color(enum color_branch ix)
@@ -882,12 +882,13 @@ static int batch_objects(struct batch_options *opt)
return retval;
}
-static int git_cat_file_config(const char *var, const char *value, void *cb)
+static int git_cat_file_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (userdiff_config(var, value) < 0)
return -1;
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static int batch_option_callback(const struct option *opt,
@@ -1182,7 +1182,8 @@ static int switch_branches(const struct checkout_opts *opts,
return ret || writeout_error;
}
-static int git_checkout_config(const char *var, const char *value, void *cb)
+static int git_checkout_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
struct checkout_opts *opts = cb;
@@ -1198,7 +1199,7 @@ static int git_checkout_config(const char *var, const char *value, void *cb)
if (starts_with(var, "submodule."))
return git_default_submodule_config(var, value, NULL);
- return git_xmerge_config(var, value, NULL);
+ return git_xmerge_config(var, value,kvi, NULL);
}
static void setup_new_branch_info_and_source_tree(
@@ -102,7 +102,8 @@ struct menu_stuff {
define_list_config_array(color_interactive_slots);
-static int git_clean_config(const char *var, const char *value, void *cb)
+static int git_clean_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
const char *slot_name;
@@ -132,7 +133,7 @@ static int git_clean_config(const char *var, const char *value, void *cb)
if (git_color_config(var, value, cb) < 0)
return -1;
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static const char *clean_get_color(enum color_clean ix)
@@ -775,7 +775,8 @@ static int checkout(int submodule_progress, int filter_submodules)
return err;
}
-static int git_clone_config(const char *k, const char *v, void *cb)
+static int git_clone_config(const char *k, const char *v,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(k, "clone.defaultremotename")) {
free(remote_name);
@@ -786,10 +787,11 @@ static int git_clone_config(const char *k, const char *v, void *cb)
if (!strcmp(k, "clone.filtersubmodules"))
config_filter_submodules = git_config_bool(k, v);
- return git_default_config(k, v, cb);
+ return git_default_config(k, v,kvi, cb);
}
-static int write_one_config(const char *key, const char *value, void *data)
+static int write_one_config(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *data)
{
/*
* give git_clone_config a chance to write config values back to the
@@ -13,7 +13,8 @@ static const char * const builtin_column_usage[] = {
};
static unsigned int colopts;
-static int column_config(const char *var, const char *value, void *cb)
+static int column_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *cb)
{
return git_column_config(var, value, cb, &colopts);
}
@@ -185,6 +185,7 @@ static int write_option_max_new_filters(const struct option *opt,
}
static int git_commit_graph_write_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *cb UNUSED)
{
if (!strcmp(var, "commitgraph.maxnewfilters"))
@@ -1402,7 +1402,8 @@ static int parse_status_slot(const char *slot)
return LOOKUP_CONFIG(color_status_slots, slot);
}
-static int git_status_config(const char *k, const char *v, void *cb)
+static int git_status_config(const char *k, const char *v,
+ struct key_value_info *kvi, void *cb)
{
struct wt_status *s = cb;
const char *slot_name;
@@ -1487,7 +1488,7 @@ static int git_status_config(const char *k, const char *v, void *cb)
s->detect_rename = git_config_rename(k, v);
return 0;
}
- return git_diff_ui_config(k, v, NULL);
+ return git_diff_ui_config(k, v,kvi, NULL);
}
int cmd_status(int argc, const char **argv, const char *prefix)
@@ -1602,7 +1603,8 @@ int cmd_status(int argc, const char **argv, const char *prefix)
return 0;
}
-static int git_commit_config(const char *k, const char *v, void *cb)
+static int git_commit_config(const char *k, const char *v,
+ struct key_value_info *kvi, void *cb)
{
struct wt_status *s = cb;
@@ -1624,7 +1626,7 @@ static int git_commit_config(const char *k, const char *v, void *cb)
return 0;
}
- return git_status_config(k, v, s);
+ return git_status_config(k, v,kvi, s);
}
int cmd_commit(int argc, const char **argv, const char *prefix)
@@ -214,7 +214,7 @@ static void show_config_scope(struct strbuf *buf)
}
static int show_all_config(const char *key_, const char *value_,
- void *cb UNUSED)
+ struct key_value_info *kvi UNUSED, void *cb UNUSED)
{
if (show_origin || show_scope) {
struct strbuf buf = STRBUF_INIT;
@@ -298,7 +298,8 @@ static int format_config(struct strbuf *buf, const char *key_, const char *value
return 0;
}
-static int collect_config(const char *key_, const char *value_, void *cb)
+static int collect_config(const char *key_, const char *value_,
+ struct key_value_info *kvi UNUSED, void *cb)
{
struct strbuf_list *values = cb;
@@ -466,6 +467,7 @@ static const char *get_colorbool_slot;
static char parsed_color[COLOR_MAXLEN];
static int git_get_color_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *cb UNUSED)
{
if (!strcmp(var, get_color_slot)) {
@@ -498,6 +500,7 @@ static int get_colorbool_found;
static int get_diff_color_found;
static int get_color_ui_found;
static int git_get_colorbool_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *data UNUSED)
{
if (!strcmp(var, get_colorbool_slot))
@@ -555,7 +558,8 @@ struct urlmatch_current_candidate_value {
struct strbuf value;
};
-static int urlmatch_collect_fn(const char *var, const char *value, void *cb)
+static int urlmatch_collect_fn(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *cb)
{
struct string_list *values = cb;
struct string_list_item *item = string_list_insert(values, var);
@@ -38,14 +38,15 @@ static const char *const builtin_difftool_usage[] = {
NULL
};
-static int difftool_config(const char *var, const char *value, void *cb)
+static int difftool_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "difftool.trustexitcode")) {
trust_exit_code = git_config_bool(var, value);
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static int print_tool_help(void)
@@ -100,7 +100,8 @@ static int fetch_write_commit_graph = -1;
static int stdin_refspecs = 0;
static int negotiate_only;
-static int git_fetch_config(const char *k, const char *v, void *cb)
+static int git_fetch_config(const char *k, const char *v,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(k, "fetch.prune")) {
fetch_prune_config = git_config_bool(k, v);
@@ -140,7 +141,7 @@ static int git_fetch_config(const char *k, const char *v, void *cb)
return 0;
}
- return git_default_config(k, v, cb);
+ return git_default_config(k, v,kvi, cb);
}
static int parse_refmap_arg(const struct option *opt, const char *arg, int unset)
@@ -1828,7 +1829,8 @@ struct remote_group_data {
struct string_list *list;
};
-static int get_remote_group(const char *key, const char *value, void *priv)
+static int get_remote_group(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *priv)
{
struct remote_group_data *g = priv;
@@ -36,7 +36,8 @@ static int fsmonitor__start_timeout_sec = 60;
#define FSMONITOR__ANNOUNCE_STARTUP "fsmonitor.announcestartup"
static int fsmonitor__announce_startup = 0;
-static int fsmonitor_config(const char *var, const char *value, void *cb)
+static int fsmonitor_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, FSMONITOR__IPC_THREADS)) {
int i = git_config_int(var, value);
@@ -66,7 +67,7 @@ static int fsmonitor_config(const char *var, const char *value, void *cb)
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
/*
@@ -287,13 +287,14 @@ static int wait_all(void)
return hit;
}
-static int grep_cmd_config(const char *var, const char *value, void *cb)
+static int grep_cmd_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
int st = grep_config(var, value, cb);
if (git_color_config(var, value, cb) < 0)
st = -1;
- else if (git_default_config(var, value, cb) < 0)
+ else if (git_default_config(var, value,kvi, cb) < 0)
st = -1;
if (!strcmp(var, "grep.threads")) {
@@ -396,7 +396,8 @@ static int add_man_viewer_info(const char *var, const char *value)
return 0;
}
-static int git_help_config(const char *var, const char *value, void *cb)
+static int git_help_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "help.format")) {
if (!value)
@@ -419,7 +420,7 @@ static int git_help_config(const char *var, const char *value, void *cb)
if (starts_with(var, "man."))
return add_man_viewer_info(var, value);
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static struct cmdnames main_cmds, other_cmds;
@@ -1578,7 +1578,8 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
strbuf_release(&pack_name);
}
-static int git_index_pack_config(const char *k, const char *v, void *cb)
+static int git_index_pack_config(const char *k, const char *v,
+ struct key_value_info *kvi, void *cb)
{
struct pack_idx_option *opts = cb;
@@ -1605,7 +1606,7 @@ static int git_index_pack_config(const char *k, const char *v, void *cb)
else
opts->flags &= ~WRITE_REV;
}
- return git_default_config(k, v, cb);
+ return git_default_config(k, v,kvi, cb);
}
static int cmp_uint32(const void *a_, const void *b_)
@@ -559,7 +559,8 @@ static int cmd_log_walk(struct rev_info *rev)
return retval;
}
-static int git_log_config(const char *var, const char *value, void *cb)
+static int git_log_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
const char *slot_name;
@@ -608,7 +609,7 @@ static int git_log_config(const char *var, const char *value, void *cb)
return 0;
}
- return git_diff_ui_config(var, value, cb);
+ return git_diff_ui_config(var, value,kvi, cb);
}
int cmd_whatchanged(int argc, const char **argv, const char *prefix)
@@ -974,7 +975,8 @@ static enum cover_from_description parse_cover_from_description(const char *arg)
die(_("%s: invalid cover from description mode"), arg);
}
-static int git_format_config(const char *var, const char *value, void *cb)
+static int git_format_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "format.headers")) {
if (!value)
@@ -1103,7 +1105,7 @@ static int git_format_config(const char *var, const char *value, void *cb)
if (!strcmp(var, "diff.noprefix"))
return 0;
- return git_log_config(var, value, cb);
+ return git_log_config(var, value,kvi, cb);
}
static const char *output_directory = NULL;
@@ -620,7 +620,8 @@ static void parse_branch_merge_options(char *bmo)
free(argv);
}
-static int git_merge_config(const char *k, const char *v, void *cb)
+static int git_merge_config(const char *k, const char *v,
+ struct key_value_info *kvi, void *cb)
{
int status;
const char *str;
@@ -665,10 +666,10 @@ static int git_merge_config(const char *k, const char *v, void *cb)
return 0;
}
- status = fmt_merge_msg_config(k, v, cb);
+ status = fmt_merge_msg_config(k, v,kvi, cb);
if (status)
return status;
- return git_diff_ui_config(k, v, cb);
+ return git_diff_ui_config(k, v,kvi, cb);
}
static int read_tree_trivial(struct object_id *common, struct object_id *head,
@@ -82,6 +82,7 @@ static struct option *add_common_options(struct option *prev)
}
static int git_multi_pack_index_write_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *cb UNUSED)
{
if (!strcmp(var, "pack.writebitmaphashcache")) {
@@ -3134,7 +3134,8 @@ static void prepare_pack(int window, int depth)
free(delta_list);
}
-static int git_pack_config(const char *k, const char *v, void *cb)
+static int git_pack_config(const char *k, const char *v,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(k, "pack.window")) {
window = git_config_int(k, v);
@@ -3226,7 +3227,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
ex->uri = xstrdup(pack_end + 1);
oidmap_put(&configured_exclusions, ex);
}
- return git_default_config(k, v, cb);
+ return git_default_config(k, v,kvi, cb);
}
/* Counters for trace2 output when in --stdin-packs mode. */
@@ -196,7 +196,8 @@ struct patch_id_opts {
int verbatim;
};
-static int git_patch_id_config(const char *var, const char *value, void *cb)
+static int git_patch_id_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
struct patch_id_opts *opts = cb;
@@ -209,7 +210,7 @@ static int git_patch_id_config(const char *var, const char *value, void *cb)
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
int cmd_patch_id(int argc, const char **argv, const char *prefix)
@@ -359,7 +359,8 @@ static enum rebase_type config_get_rebase(int *rebase_unspecified)
/**
* Read config variables.
*/
-static int git_pull_config(const char *var, const char *value, void *cb)
+static int git_pull_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "rebase.autostash")) {
config_autostash = git_config_bool(var, value);
@@ -372,7 +373,7 @@ static int git_pull_config(const char *var, const char *value, void *cb)
check_trust_level = 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
/**
@@ -506,7 +506,8 @@ static void set_push_cert_flags(int *flags, int v)
}
-static int git_push_config(const char *k, const char *v, void *cb)
+static int git_push_config(const char *k, const char *v,
+ struct key_value_info *kvi, void *cb)
{
const char *slot_name;
int *flags = cb;
@@ -573,7 +574,7 @@ static int git_push_config(const char *k, const char *v, void *cb)
return 0;
}
- return git_default_config(k, v, NULL);
+ return git_default_config(k, v,kvi, NULL);
}
int cmd_push(int argc, const char **argv, const char *prefix)
@@ -100,12 +100,13 @@ static int debug_merge(const struct cache_entry * const *stages,
return 0;
}
-static int git_read_tree_config(const char *var, const char *value, void *cb)
+static int git_read_tree_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "submodule.recurse"))
return git_default_submodule_config(var, value, cb);
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
@@ -791,7 +791,8 @@ static void parse_rebase_merges_value(struct rebase_options *options, const char
die(_("Unknown rebase-merges mode: %s"), value);
}
-static int rebase_config(const char *var, const char *value, void *data)
+static int rebase_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *data)
{
struct rebase_options *opts = data;
@@ -850,7 +851,7 @@ static int rebase_config(const char *var, const char *value, void *data)
return git_config_string(&opts->default_backend, var, value);
}
- return git_default_config(var, value, data);
+ return git_default_config(var, value,kvi, data);
}
static int checkout_up_to_date(struct rebase_options *options)
@@ -135,7 +135,8 @@ static enum deny_action parse_deny_action(const char *var, const char *value)
return DENY_IGNORE;
}
-static int receive_pack_config(const char *var, const char *value, void *cb)
+static int receive_pack_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
int status = parse_hide_refs_config(var, value, "receive", &hidden_refs);
@@ -262,7 +263,7 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static void show_ref(const char *path, const struct object_id *oid)
@@ -108,7 +108,8 @@ static struct reflog_expire_cfg *find_cfg_ent(const char *pattern, size_t len)
#define EXPIRE_TOTAL 01
#define EXPIRE_UNREACH 02
-static int reflog_expire_config(const char *var, const char *value, void *cb)
+static int reflog_expire_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
const char *pattern, *key;
size_t pattern_len;
@@ -117,7 +118,7 @@ static int reflog_expire_config(const char *var, const char *value, void *cb)
struct reflog_expire_cfg *ent;
if (parse_config_key(var, "gc", &pattern, &pattern_len, &key) < 0)
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
if (!strcmp(key, "reflogexpire")) {
slot = EXPIRE_TOTAL;
@@ -128,7 +129,7 @@ static int reflog_expire_config(const char *var, const char *value, void *cb)
if (git_config_expiry_date(&expire, var, value))
return -1;
} else
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
if (!pattern) {
switch (slot) {
@@ -268,6 +268,7 @@ static const char *abbrev_ref(const char *name, const char *prefix)
#define abbrev_branch(name) abbrev_ref((name), "refs/heads/")
static int config_read_branches(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED,
void *data UNUSED)
{
const char *orig_key = key;
@@ -645,7 +646,7 @@ struct push_default_info
};
static int config_read_push_default(const char *key, const char *value,
- void *cb)
+ struct key_value_info *kvi UNUSED, void *cb)
{
struct push_default_info* info = cb;
if (strcmp(key, "remote.pushdefault") ||
@@ -1494,7 +1495,8 @@ static int prune(int argc, const char **argv, const char *prefix)
return result;
}
-static int get_remote_default(const char *key, const char *value UNUSED, void *priv)
+static int get_remote_default(const char *key, const char *value UNUSED,
+ struct key_value_info *kvi UNUSED, void *priv)
{
if (strcmp(key, "remotes.default") == 0) {
int *found = priv;
@@ -58,7 +58,8 @@ struct pack_objects_args {
int local;
};
-static int repack_config(const char *var, const char *value, void *cb)
+static int repack_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
struct pack_objects_args *cruft_po_args = cb;
if (!strcmp(var, "repack.usedeltabaseoffset")) {
@@ -90,7 +91,7 @@ static int repack_config(const char *var, const char *value, void *cb)
return git_config_string(&cruft_po_args->depth, var, value);
if (!strcmp(var, "repack.cruftthreads"))
return git_config_string(&cruft_po_args->threads, var, value);
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
/*
@@ -308,12 +308,13 @@ static int reset_refs(const char *rev, const struct object_id *oid)
return update_ref_status;
}
-static int git_reset_config(const char *var, const char *value, void *cb)
+static int git_reset_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "submodule.recurse"))
return git_default_submodule_config(var, value, cb);
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
int cmd_reset(int argc, const char **argv, const char *prefix)
@@ -131,7 +131,8 @@ static void print_helper_status(struct ref *ref)
strbuf_release(&buf);
}
-static int send_pack_config(const char *k, const char *v, void *cb)
+static int send_pack_config(const char *k, const char *v,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(k, "push.gpgsign")) {
const char *value;
@@ -151,7 +152,7 @@ static int send_pack_config(const char *k, const char *v, void *cb)
}
}
}
- return git_default_config(k, v, cb);
+ return git_default_config(k, v,kvi, cb);
}
int cmd_send_pack(int argc, const char **argv, const char *prefix)
@@ -556,7 +556,8 @@ static void append_one_rev(const char *av)
die("bad sha1 reference %s", av);
}
-static int git_show_branch_config(const char *var, const char *value, void *cb)
+static int git_show_branch_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "showbranch.default")) {
if (!value)
@@ -579,7 +580,7 @@ static int git_show_branch_config(const char *var, const char *value, void *cb)
if (git_color_config(var, value, cb) < 0)
return -1;
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static int omit_in_dense(struct commit *commit, struct commit **rev, int n)
@@ -836,7 +836,8 @@ static int show_stat = 1;
static int show_patch;
static int show_include_untracked;
-static int git_stash_config(const char *var, const char *value, void *cb)
+static int git_stash_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "stash.showstat")) {
show_stat = git_config_bool(var, value);
@@ -850,7 +851,7 @@ static int git_stash_config(const char *var, const char *value, void *cb)
show_include_untracked = git_config_bool(var, value);
return 0;
}
- return git_diff_basic_config(var, value, cb);
+ return git_diff_basic_config(var, value,kvi, cb);
}
static void diff_include_untracked(const struct stash_info *info, struct diff_options *diff_opt)
@@ -2187,6 +2187,7 @@ static int update_clone_task_finished(int result,
}
static int git_update_clone_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *cb)
{
int *max_jobs = cb;
@@ -183,7 +183,8 @@ static const char tag_template_nocleanup[] =
"Lines starting with '%c' will be kept; you may remove them"
" yourself if you want to.\n");
-static int git_tag_config(const char *var, const char *value, void *cb)
+static int git_tag_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "tag.gpgsign")) {
config_sign_tag = git_config_bool(var, value);
@@ -208,7 +209,7 @@ static int git_tag_config(const char *var, const char *value, void *cb)
if (git_color_config(var, value, cb) < 0)
return -1;
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static void write_tag_body(int fd, const struct object_id *oid)
@@ -69,13 +69,14 @@ static const struct git_var *get_git_var(const char *var)
return NULL;
}
-static int show_config(const char *var, const char *value, void *cb)
+static int show_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (value)
printf("%s=%s\n", var, value);
else
printf("%s\n", var);
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
int cmd_var(int argc, const char **argv, const char *prefix UNUSED)
@@ -103,14 +103,15 @@ static int verbose;
static int guess_remote;
static timestamp_t expire;
-static int git_worktree_config(const char *var, const char *value, void *cb)
+static int git_worktree_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "worktree.guessremote")) {
guess_remote = git_config_bool(var, value);
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static int delete_git_dir(const char *id)
@@ -223,7 +223,9 @@ static int bundle_list_update(const char *key, const char *value,
return 0;
}
-static int config_to_bundle_list(const char *key, const char *value, void *data)
+static int config_to_bundle_list(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED,
+ void *data)
{
struct bundle_list *list = data;
return bundle_list_update(key, value, list);
@@ -871,7 +873,9 @@ cached:
return advertise_bundle_uri;
}
-static int config_to_packet_line(const char *key, const char *value, void *data)
+static int config_to_packet_line(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED,
+ void *data)
{
struct packet_reader *writer = data;
@@ -156,7 +156,8 @@ struct config_include_data {
};
#define CONFIG_INCLUDE_INIT { 0 }
-static int git_config_include(const char *var, const char *value, void *data);
+static int git_config_include(const char *var, const char *value,
+ struct key_value_info *kvi, void *data);
#define MAX_INCLUDE_DEPTH 10
static const char include_depth_advice[] = N_(
@@ -336,7 +337,8 @@ static int include_by_branch(const char *cond, size_t cond_len)
return ret;
}
-static int add_remote_url(const char *var, const char *value, void *data)
+static int add_remote_url(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *data)
{
struct string_list *remote_urls = data;
const char *remote_name;
@@ -364,6 +366,7 @@ static void populate_remote_urls(struct config_include_data *inc)
}
static int forbid_remote_url(const char *var, const char *value UNUSED,
+ struct key_value_info *kvi UNUSED,
void *data UNUSED)
{
const char *remote_name;
@@ -429,7 +432,8 @@ static int include_condition_is_true(struct key_value_info *kvi,
static int kvi_fn(config_fn_t fn, const char *key, const char *value,
struct key_value_info *kvi, void *data);
-static int git_config_include(const char *var, const char *value, void *data)
+static int git_config_include(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *data)
{
struct config_include_data *inc = data;
struct key_value_info *kvi = inc->config_reader->config_kvi;
@@ -1541,7 +1545,8 @@ int git_config_color(char *dest, const char *var, const char *value)
return 0;
}
-static int git_default_core_config(const char *var, const char *value, void *cb)
+static int git_default_core_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
/* This needs a better name */
if (!strcmp(var, "core.filemode")) {
@@ -1826,7 +1831,7 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
}
/* Add other config variables here and to Documentation/config.txt. */
- return platform_core_config(var, value, cb);
+ return platform_core_config(var, value,kvi, cb);
}
static int git_default_sparse_config(const char *var, const char *value)
@@ -1928,15 +1933,16 @@ static int git_default_mailmap_config(const char *var, const char *value)
return 0;
}
-int git_default_config(const char *var, const char *value, void *cb)
+int git_default_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (starts_with(var, "core."))
- return git_default_core_config(var, value, cb);
+ return git_default_core_config(var, value,kvi, cb);
if (starts_with(var, "user.") ||
starts_with(var, "author.") ||
starts_with(var, "committer."))
- return git_ident_config(var, value, cb);
+ return git_ident_config(var, value,kvi, cb);
if (starts_with(var, "i18n."))
return git_default_i18n_config(var, value);
@@ -2455,7 +2461,8 @@ struct configset_add_data {
};
#define CONFIGSET_ADD_INIT { 0 }
-static int config_set_callback(const char *key, const char *value, void *cb)
+static int config_set_callback(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *cb)
{
struct configset_add_data *data = cb;
configset_add_value(data->config_reader, data->config_set, key, value);
@@ -3063,7 +3070,8 @@ static int store_aux_event(enum config_event_t type, size_t begin, size_t end,
return 0;
}
-static int store_aux(const char *key, const char *value, void *cb)
+static int store_aux(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *cb)
{
struct config_store_data *store = cb;
@@ -146,7 +146,8 @@ struct key_value_info {
*/
typedef int (*config_fn_t)(const char *, const char *, struct key_value_info *, void *);
-int git_default_config(const char *, const char *, void *);
+int git_default_config(const char *, const char *, struct key_value_info *,
+ void *);
/**
* Read a specific file in git-config format.
@@ -962,7 +962,7 @@ static struct child_process *git_tcp_connect(int fd[2], char *host, int flags)
static char *git_proxy_command;
static int git_proxy_command_options(const char *var, const char *value,
- void *cb)
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "core.gitproxy")) {
const char *for_pos;
@@ -1008,7 +1008,7 @@ static int git_proxy_command_options(const char *var, const char *value,
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static int git_use_proxy(const char *host)
@@ -1011,7 +1011,9 @@ static int apply_filter(const char *path, const char *src, size_t len,
return 0;
}
-static int read_convert_config(const char *var, const char *value, void *cb UNUSED)
+static int read_convert_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
+ void *cb UNUSED)
{
const char *key, *name;
size_t namelen;
@@ -46,6 +46,7 @@ static int credential_from_potentially_partial_url(struct credential *c,
const char *url);
static int credential_config_callback(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *data)
{
struct credential *c = data;
@@ -341,7 +341,8 @@ static void free_remote_islands(kh_str_t *remote_islands)
kh_destroy_str(remote_islands);
}
-static int island_config_callback(const char *k, const char *v, void *cb)
+static int island_config_callback(const char *k, const char *v,
+ struct key_value_info *kvi UNUSED, void *cb)
{
struct island_load_data *ild = cb;
@@ -350,7 +350,8 @@ static unsigned parse_color_moved_ws(const char *arg)
return ret;
}
-int git_diff_ui_config(const char *var, const char *value, void *cb)
+int git_diff_ui_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
diff_use_color_default = git_config_colorbool(var, value);
@@ -433,10 +434,11 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
if (git_color_config(var, value, cb) < 0)
return -1;
- return git_diff_basic_config(var, value, cb);
+ return git_diff_basic_config(var, value,kvi, cb);
}
-int git_diff_basic_config(const char *var, const char *value, void *cb)
+int git_diff_basic_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
const char *name;
@@ -488,7 +490,7 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
if (git_diff_heuristic_config(var, value, cb) < 0)
return -1;
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static char *quote_two(const char *one, const char *two)
@@ -532,10 +532,12 @@ void free_diffstat_info(struct diffstat_t *diffstat);
int parse_long_opt(const char *opt, const char **argv,
const char **optarg);
-int git_diff_basic_config(const char *var, const char *value, void *cb);
+int git_diff_basic_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb);
int git_diff_heuristic_config(const char *var, const char *value, void *cb);
void init_diff_ui_defaults(void);
-int git_diff_ui_config(const char *var, const char *value, void *cb);
+int git_diff_ui_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb);
void repo_diff_setup(struct repository *, struct diff_options *);
struct option *add_diff_options(const struct option *, struct diff_options *);
int diff_opt_parse(struct diff_options *, const char **, int, const char *);
@@ -1858,7 +1858,8 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
return ref;
}
-static int fetch_pack_config_cb(const char *var, const char *value, void *cb)
+static int fetch_pack_config_cb(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (strcmp(var, "fetch.fsck.skiplist") == 0) {
const char *path;
@@ -1880,7 +1881,7 @@ static int fetch_pack_config_cb(const char *var, const char *value, void *cb)
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
static void fetch_pack_config(void)
@@ -19,7 +19,8 @@ static int use_branch_desc;
static int suppress_dest_pattern_seen;
static struct string_list suppress_dest_patterns = STRING_LIST_INIT_DUP;
-int fmt_merge_msg_config(const char *key, const char *value, void *cb)
+int fmt_merge_msg_config(const char *key, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(key, "merge.log") || !strcmp(key, "merge.summary")) {
int is_bool;
@@ -39,7 +40,7 @@ int fmt_merge_msg_config(const char *key, const char *value, void *cb)
string_list_append(&suppress_dest_patterns, value);
suppress_dest_pattern_seen = 1;
} else {
- return git_default_config(key, value, cb);
+ return git_default_config(key, value,kvi, cb);
}
return 0;
}
@@ -13,7 +13,8 @@ struct fmt_merge_msg_opts {
};
extern int merge_log_config;
-int fmt_merge_msg_config(const char *key, const char *value, void *cb);
+int fmt_merge_msg_config(const char *key, const char *value,
+ struct key_value_info *kvi, void *cb);
int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
struct fmt_merge_msg_opts *);
@@ -1162,7 +1162,8 @@ struct fsck_gitmodules_data {
int ret;
};
-static int fsck_gitmodules_fn(const char *var, const char *value, void *vdata)
+static int fsck_gitmodules_fn(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *vdata)
{
struct fsck_gitmodules_data *data = vdata;
const char *subsection, *key;
@@ -1373,7 +1374,8 @@ int fsck_finish(struct fsck_options *options)
return ret;
}
-int git_fsck_config(const char *var, const char *value, void *cb)
+int git_fsck_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
struct fsck_options *options = cb;
if (strcmp(var, "fsck.skiplist") == 0) {
@@ -1394,7 +1396,7 @@ int git_fsck_config(const char *var, const char *value, void *cb)
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
/*
@@ -237,6 +237,7 @@ const char *fsck_describe_object(struct fsck_options *options,
* git_config() callback for use by fsck-y tools that want to support
* fsck.<msg> fsck.skipList etc.
*/
-int git_fsck_config(const char *var, const char *value, void *cb);
+int git_fsck_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb);
#endif
@@ -12,7 +12,8 @@
#include "alias.h"
#include "wrapper.h"
-static int git_gpg_config(const char *, const char *, void *);
+static int git_gpg_config(const char *, const char *, struct key_value_info *,
+ void *);
static void gpg_interface_lazy_init(void)
{
@@ -718,7 +719,8 @@ void set_signing_key(const char *key)
configured_signing_key = xstrdup(key);
}
-static int git_gpg_config(const char *var, const char *value, void *cb UNUSED)
+static int git_gpg_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *cb UNUSED)
{
struct gpg_format *fmt = NULL;
char *fmtname = NULL;
@@ -54,7 +54,8 @@ define_list_config_array_extra(color_grep_slots, {"match"});
* Read the configuration file once and store it in
* the grep_defaults template.
*/
-int grep_config(const char *var, const char *value, void *cb)
+int grep_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *cb)
{
struct grep_opt *opt = cb;
const char *slot;
@@ -309,7 +309,8 @@ void load_command_list(const char *prefix,
exclude_cmds(other_cmds, main_cmds);
}
-static int get_colopts(const char *var, const char *value, void *data)
+static int get_colopts(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *data)
{
unsigned int *colopts = data;
@@ -459,7 +460,8 @@ void list_developer_interfaces_help(void)
putchar('\n');
}
-static int get_alias(const char *var, const char *value, void *data)
+static int get_alias(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *data)
{
struct string_list *list = data;
@@ -543,6 +545,7 @@ static struct cmdnames aliases;
#define AUTOCORRECT_IMMEDIATELY (-1)
static int git_unknown_cmd_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *cb UNUSED)
{
const char *p;
@@ -671,7 +671,8 @@ static int set_ident(const char *var, const char *value)
return 0;
}
-int git_ident_config(const char *var, const char *value, void *data UNUSED)
+int git_ident_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *data UNUSED)
{
if (!strcmp(var, "user.useconfigonly")) {
ident_use_config_only = git_config_bool(var, value);
@@ -62,6 +62,7 @@ const char *fmt_name(enum want_ident);
int committer_ident_sufficiently_given(void);
int author_ident_sufficiently_given(void);
-int git_ident_config(const char *, const char *, void *);
+int git_ident_config(const char *, const char *,
+ struct key_value_info *UNUSED, void *);
#endif
@@ -1322,7 +1322,8 @@ static int split_msg(struct strbuf *all_msgs, struct strbuf *msg, int *ofs)
return 1;
}
-static int git_imap_config(const char *var, const char *val, void *cb)
+static int git_imap_config(const char *var, const char *val,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp("imap.sslverify", var))
@@ -1356,7 +1357,7 @@ static int git_imap_config(const char *var, const char *val, void *cb)
server.host = xstrdup(val);
}
} else
- return git_default_config(var, val, cb);
+ return git_default_config(var, val,kvi, cb);
return 0;
}
@@ -252,6 +252,7 @@ static struct ll_merge_driver *ll_user_merge, **ll_user_merge_tail;
static const char *default_ll_merge;
static int read_merge_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *cb UNUSED)
{
struct ll_merge_driver *fn;
@@ -136,7 +136,7 @@ static void send_possibly_unborn_head(struct ls_refs_data *data)
}
static int ls_refs_config(const char *var, const char *value,
- void *cb_data)
+ struct key_value_info *kvi UNUSED, void *cb_data)
{
struct ls_refs_data *data = cb_data;
/*
@@ -1241,12 +1241,13 @@ int mailinfo_parse_quoted_cr_action(const char *actionstr, int *action)
return 0;
}
-static int git_mailinfo_config(const char *var, const char *value, void *mi_)
+static int git_mailinfo_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *mi_)
{
struct mailinfo *mi = mi_;
if (!starts_with(var, "mailinfo."))
- return git_default_config(var, value, NULL);
+ return git_default_config(var, value,kvi, NULL);
if (!strcmp(var, "mailinfo.scissors")) {
mi->use_scissors = git_config_bool(var, value);
return 0;
@@ -93,7 +93,8 @@ static combine_notes_fn parse_combine_notes_fn(const char *v)
return NULL;
}
-static int notes_rewrite_config(const char *k, const char *v, void *cb)
+static int notes_rewrite_config(const char *k, const char *v,
+ struct key_value_info *kvi UNUSED, void *cb)
{
struct notes_rewrite_cfg *c = cb;
if (starts_with(k, "notes.rewrite.") && !strcmp(k+14, c->cmd)) {
@@ -973,7 +973,8 @@ void string_list_add_refs_from_colon_sep(struct string_list *list,
free(globs_copy);
}
-static int notes_display_config(const char *k, const char *v, void *cb)
+static int notes_display_config(const char *k, const char *v,
+ struct key_value_info *kvi UNUSED, void *cb)
{
int *load_refs = cb;
@@ -39,6 +39,7 @@ static void wait_for_pager_signal(int signo)
}
static int core_pager_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *data UNUSED)
{
if (!strcmp(var, "core.pager"))
@@ -224,7 +225,9 @@ struct pager_command_config_data {
char *value;
};
-static int pager_command_config(const char *var, const char *value, void *vdata)
+static int pager_command_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
+ void *vdata)
{
struct pager_command_config_data *data = vdata;
const char *cmd;
@@ -55,6 +55,7 @@ static void save_user_format(struct rev_info *rev, const char *cp, int is_tforma
}
static int git_pretty_formats_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *cb UNUSED)
{
struct cmt_fmt_map *commit_format = NULL;
@@ -99,7 +99,9 @@ static void promisor_remote_move_to_tail(struct promisor_remote_config *config,
config->promisors_tail = &r->next;
}
-static int promisor_remote_config(const char *var, const char *value, void *data)
+static int promisor_remote_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
+ void *data)
{
struct promisor_remote_config *config = data;
const char *name;
@@ -348,7 +348,8 @@ static void read_branches_file(struct remote_state *remote_state,
remote->fetch_tags = 1; /* always auto-follow */
}
-static int handle_config(const char *key, const char *value, void *cb)
+static int handle_config(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *cb)
{
const char *name;
size_t namelen;
@@ -1569,7 +1569,8 @@ struct exclude_hidden_refs_cb {
const char *section;
};
-static int hide_refs_config(const char *var, const char *value, void *cb_data)
+static int hide_refs_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *cb_data)
{
struct exclude_hidden_refs_cb *cb = cb_data;
cb->exclusions->hidden_refs_configured = 1;
@@ -593,7 +593,8 @@ static int cmd_register(int argc, const char **argv)
return register_dir();
}
-static int get_scalar_repos(const char *key, const char *value, void *data)
+static int get_scalar_repos(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *data)
{
struct string_list *list = data;
@@ -214,7 +214,8 @@ static struct update_ref_record *init_update_ref_record(const char *ref)
return rec;
}
-static int git_sequencer_config(const char *k, const char *v, void *cb)
+static int git_sequencer_config(const char *k, const char *v,
+ struct key_value_info *kvi, void *cb)
{
struct replay_opts *opts = cb;
int status;
@@ -269,7 +270,7 @@ static int git_sequencer_config(const char *k, const char *v, void *cb)
if (opts->action == REPLAY_REVERT && !strcmp(k, "revert.reference"))
opts->commit_use_reference = git_config_bool(k, v);
- return git_diff_basic_config(k, v, NULL);
+ return git_diff_basic_config(k, v,kvi, NULL);
}
void sequencer_init_config(struct replay_opts *opts)
@@ -2876,7 +2877,8 @@ static int git_config_string_dup(char **dest,
return 0;
}
-static int populate_opts_cb(const char *key, const char *value, void *data)
+static int populate_opts_cb(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *data)
{
struct replay_opts *opts = data;
int error_flag = 1;
@@ -514,7 +514,9 @@ no_prevention_needed:
startup_info->original_cwd = NULL;
}
-static int read_worktree_config(const char *var, const char *value, void *vdata)
+static int read_worktree_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
+ void *vdata)
{
struct repository_format *data = vdata;
@@ -585,7 +587,8 @@ static enum extension_result handle_extension(const char *var,
return EXTENSION_UNKNOWN;
}
-static int check_repo_format(const char *var, const char *value, void *vdata)
+static int check_repo_format(const char *var, const char *value,
+ struct key_value_info *kvi, void *vdata)
{
struct repository_format *data = vdata;
const char *ext;
@@ -614,7 +617,7 @@ static int check_repo_format(const char *var, const char *value, void *vdata)
}
}
- return read_worktree_config(var, value, vdata);
+ return read_worktree_config(var, value,kvi, vdata);
}
static int check_repository_format_gently(const char *gitdir, struct repository_format *candidate, int *nongit_ok)
@@ -1113,7 +1116,8 @@ struct safe_directory_data {
int is_safe;
};
-static int safe_directory_cb(const char *key, const char *value, void *d)
+static int safe_directory_cb(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *d)
{
struct safe_directory_data *data = d;
@@ -1169,7 +1173,8 @@ static int ensure_valid_ownership(const char *gitfile,
return data.is_safe;
}
-static int allowed_bare_repo_cb(const char *key, const char *value, void *d)
+static int allowed_bare_repo_cb(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *d)
{
enum allowed_bare_repo *allowed_bare_repo = d;
@@ -424,7 +424,8 @@ struct parse_config_parameter {
* config store (.git/config, etc). Callers are responsible for
* checking for overrides in the main config store when appropriate.
*/
-static int parse_config(const char *var, const char *value, void *data)
+static int parse_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *data)
{
struct parse_config_parameter *me = data;
struct submodule *submodule;
@@ -673,7 +674,8 @@ out:
}
}
-static int gitmodules_cb(const char *var, const char *value, void *data)
+static int gitmodules_cb(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *data)
{
struct repository *repo = data;
struct parse_config_parameter parameter;
@@ -801,7 +803,9 @@ void submodule_free(struct repository *r)
submodule_cache_clear(r->submodule_cache);
}
-static int config_print_callback(const char *var, const char *value, void *cb_data)
+static int config_print_callback(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
+ void *cb_data)
{
char *wanted_key = cb_data;
@@ -843,7 +847,9 @@ struct fetch_config {
int *recurse_submodules;
};
-static int gitmodules_fetch_config(const char *var, const char *value, void *cb)
+static int gitmodules_fetch_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
+ void *cb)
{
struct fetch_config *config = cb;
if (!strcmp(var, "submodule.fetchjobs")) {
@@ -871,6 +877,7 @@ void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules)
}
static int gitmodules_update_clone_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
void *cb)
{
int *max_jobs = cb;
@@ -42,7 +42,8 @@
*
*/
-static int iterate_cb(const char *var, const char *value, void *data UNUSED)
+static int iterate_cb(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *data UNUSED)
{
static int nr;
@@ -59,7 +60,8 @@ static int iterate_cb(const char *var, const char *value, void *data UNUSED)
return 0;
}
-static int parse_int_cb(const char *var, const char *value, void *data)
+static int parse_int_cb(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *data)
{
const char *key_to_match = data;
@@ -70,7 +72,8 @@ static int parse_int_cb(const char *var, const char *value, void *data)
return 0;
}
-static int early_config_cb(const char *var, const char *value, void *vdata)
+static int early_config_cb(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *vdata)
{
const char *key = vdata;
@@ -12,7 +12,9 @@ static int driver_cb(struct userdiff_driver *driver,
return 0;
}
-static int cmd__userdiff_config(const char *var, const char *value, void *cb UNUSED)
+static int cmd__userdiff_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
+ void *cb UNUSED)
{
if (userdiff_config(var, value) < 0)
return -1;
@@ -99,7 +99,8 @@ struct tr2_cfg_data {
/*
* See if the given config key matches any of our patterns of interest.
*/
-static int tr2_cfg_cb(const char *key, const char *value, void *d)
+static int tr2_cfg_cb(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *d)
{
struct strbuf **s;
struct tr2_cfg_data *data = (struct tr2_cfg_data *)d;
@@ -57,7 +57,8 @@ static struct tr2_sysenv_entry tr2_sysenv_settings[] = {
};
/* clang-format on */
-static int tr2_sysenv_cb(const char *key, const char *value, void *d)
+static int tr2_sysenv_cb(const char *key, const char *value,
+ struct key_value_info *kvi UNUSED, void *d)
{
int k;
@@ -482,6 +482,7 @@ static struct {
};
static int git_trailer_default_config(const char *conf_key, const char *value,
+ struct key_value_info *kvi UNUSED,
void *cb UNUSED)
{
const char *trailer_item, *variable_name;
@@ -514,6 +515,7 @@ static int git_trailer_default_config(const char *conf_key, const char *value,
}
static int git_trailer_config(const char *conf_key, const char *value,
+ struct key_value_info *kvi UNUSED,
void *cb UNUSED)
{
const char *trailer_item, *variable_name;
@@ -1298,7 +1298,9 @@ static int parse_object_filter_config(const char *var, const char *value,
return 0;
}
-static int upload_pack_config(const char *var, const char *value, void *cb_data)
+static int upload_pack_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
+ void *cb_data)
{
struct upload_pack_data *data = cb_data;
@@ -1339,7 +1341,9 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data)
return parse_hide_refs_config(var, value, "uploadpack", &data->hidden_refs);
}
-static int upload_pack_protected_config(const char *var, const char *value, void *cb_data)
+static int upload_pack_protected_config(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED,
+ void *cb_data)
{
struct upload_pack_data *data = cb_data;
@@ -551,7 +551,8 @@ static int cmp_matches(const struct urlmatch_item *a,
return 0;
}
-int urlmatch_config_entry(const char *var, const char *value, void *cb)
+int urlmatch_config_entry(const char *var, const char *value,
+ struct key_value_info *kvi UNUSED, void *cb)
{
struct string_list_item *item;
struct urlmatch_config *collect = cb;
@@ -71,7 +71,8 @@ struct urlmatch_config {
.vars = STRING_LIST_INIT_DUP, \
}
-int urlmatch_config_entry(const char *var, const char *value, void *cb);
+int urlmatch_config_entry(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb);
void urlmatch_config_release(struct urlmatch_config *config);
#endif /* URL_MATCH_H */
@@ -307,7 +307,8 @@ int xdiff_compare_lines(const char *l1, long s1,
int git_xmerge_style = -1;
-int git_xmerge_config(const char *var, const char *value, void *cb)
+int git_xmerge_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb)
{
if (!strcmp(var, "merge.conflictstyle")) {
if (!value)
@@ -327,5 +328,5 @@ int git_xmerge_config(const char *var, const char *value, void *cb)
value, var);
return 0;
}
- return git_default_config(var, value, cb);
+ return git_default_config(var, value,kvi, cb);
}
@@ -50,7 +50,8 @@ int buffer_is_binary(const char *ptr, unsigned long size);
void xdiff_set_find_func(xdemitconf_t *xecfg, const char *line, int cflags);
void xdiff_clear_find_func(xdemitconf_t *xecfg);
-int git_xmerge_config(const char *var, const char *value, void *cb);
+int git_xmerge_config(const char *var, const char *value,
+ struct key_value_info *kvi, void *cb);
extern int git_xmerge_style;
/*