MCPcopy Index your code
hub / github.com/git/git / git_status_config

Function git_status_config

builtin/commit.c:1451–1535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1449}
1450
1451static int git_status_config(const char *k, const char *v,
1452 const struct config_context *ctx, void *cb)
1453{
1454 struct wt_status *s = cb;
1455 const char *slot_name;
1456
1457 if (starts_with(k, "column."))
1458 return git_column_config(k, v, "status", &s->colopts);
1459 if (!strcmp(k, "status.submodulesummary")) {
1460 int is_bool;
1461 s->submodule_summary = git_config_bool_or_int(k, v, ctx->kvi,
1462 &is_bool);
1463 if (is_bool && s->submodule_summary)
1464 s->submodule_summary = -1;
1465 return 0;
1466 }
1467 if (!strcmp(k, "status.short")) {
1468 if (git_config_bool(k, v))
1469 status_deferred_config.status_format = STATUS_FORMAT_SHORT;
1470 else
1471 status_deferred_config.status_format = STATUS_FORMAT_NONE;
1472 return 0;
1473 }
1474 if (!strcmp(k, "status.branch")) {
1475 status_deferred_config.show_branch = git_config_bool(k, v);
1476 return 0;
1477 }
1478 if (!strcmp(k, "status.aheadbehind")) {
1479 status_deferred_config.ahead_behind = git_config_bool(k, v);
1480 return 0;
1481 }
1482 if (!strcmp(k, "status.showstash")) {
1483 s->show_stash = git_config_bool(k, v);
1484 return 0;
1485 }
1486 if (!strcmp(k, "status.color") || !strcmp(k, "color.status")) {
1487 s->use_color = git_config_colorbool(k, v);
1488 return 0;
1489 }
1490 if (!strcmp(k, "status.displaycommentprefix")) {
1491 s->display_comment_prefix = git_config_bool(k, v);
1492 return 0;
1493 }
1494 if (skip_prefix(k, "status.color.", &slot_name) ||
1495 skip_prefix(k, "color.status.", &slot_name)) {
1496 int slot = parse_status_slot(slot_name);
1497 if (slot < 0)
1498 return 0;
1499 if (!v)
1500 return config_error_nonbool(k);
1501 return color_parse(v, s->color_palette[slot]);
1502 }
1503 if (!strcmp(k, "status.relativepaths")) {
1504 s->relative_paths = git_config_bool(k, v);
1505 return 0;
1506 }
1507 if (!strcmp(k, "status.showuntrackedfiles")) {
1508 enum untracked_status_type u;

Callers 1

git_commit_configFunction · 0.85

Calls 13

starts_withFunction · 0.85
git_column_configFunction · 0.85
git_config_bool_or_intFunction · 0.85
git_config_boolFunction · 0.85
git_config_colorboolFunction · 0.85
parse_status_slotFunction · 0.85
config_error_nonboolFunction · 0.85
color_parseFunction · 0.85
errorFunction · 0.85
git_config_intFunction · 0.85
git_config_renameFunction · 0.85

Tested by

no test coverage detected