static int git_status_config(const char *k, const char *v, void *cb) { struct wt_status *s = cb; if (starts_with(k, "column.")) return git_column_config(k, v, "status", &s->colopts); if (!strcmp(k, "status.submodulesummary")) { int is_bool; s->submodule_summary = git_config_bool_or_int(k, v, &is_bool); if (is_bool && s->submodule_summary) s->submodule_summary = -1; return 0; } if (!strcmp(k, "status.short")) { if (git_config_bool(k, v)) status_deferred_config.status_format = STATUS_FORMAT_SHORT; else status_deferred_config.status_format = STATUS_FORMAT_NONE; return 0; } if (!strcmp(k, "status.branch")) { status_deferred_config.show_branch = git_config_bool(k, v); return 0; } if (!strcmp(k, "status.color") || !strcmp(k, "color.status")) { s->use_color = git_config_colorbool(k, v); return 0; } if (!strcmp(k, "status.displaycommentprefix")) { s->display_comment_prefix = git_config_bool(k, v); return 0; } if (starts_with(k, "status.color.") || starts_with(k, "color.status.")) { int slot = parse_status_slot(k, 13); if (slot < 0) return 0; if (!v) return config_error_nonbool(k); color_parse(v, k, s->color_palette[slot]); return 0; } if (!strcmp(k, "status.relativepaths")) { s->relative_paths = git_config_bool(k, v); return 0; } if (!strcmp(k, "status.showuntrackedfiles")) { if (!v) return config_error_nonbool(k); else if (!strcmp(v, "no")) s->show_untracked_files = SHOW_NO_UNTRACKED_FILES; else if (!strcmp(v, "normal")) s->show_untracked_files = SHOW_NORMAL_UNTRACKED_FILES; else if (!strcmp(v, "all")) s->show_untracked_files = SHOW_ALL_UNTRACKED_FILES; else return error(_("Invalid untracked files mode '%s'"), v); return 0; } return git_diff_ui_config(k, v, NULL); }
static int git_branch_config(const char *var, const char *value, void *cb) { if (starts_with(var, "column.")) return git_column_config(var, value, "branch", &colopts); if (!strcmp(var, "color.branch")) { branch_use_color = git_config_colorbool(var, value); return 0; } if (starts_with(var, "color.branch.")) { int slot = parse_branch_color_slot(var, 13); if (slot < 0) return 0; if (!value) return config_error_nonbool(var); color_parse(value, var, branch_colors[slot]); return 0; } return git_color_default_config(var, value, cb); }
static int git_tag_config(const char *var, const char *value, void *cb) { int status; struct ref_sorting **sorting_tail = (struct ref_sorting **)cb; if (!strcmp(var, "tag.sort")) { if (!value) return config_error_nonbool(var); parse_sorting_string(value, sorting_tail); return 0; } status = git_gpg_config(var, value, cb); if (status) return status; if (!strcmp(var, "tag.forcesignannotated")) { force_sign_annotate = git_config_bool(var, value); return 0; } if (starts_with(var, "column.")) return git_column_config(var, value, "tag", &colopts); return git_default_config(var, value, cb); }
static int column_config(const char *var, const char *value, void *cb) { return git_column_config(var, value, cb, &colopts); }