#include "git-compat-util.h" #include "config.h" #include "dir.h" #include "tr2_sysenv.h" /* * Each entry represents a trace2 setting. * See Documentation/technical/api-trace2.txt */ struct tr2_sysenv_entry { … }; /* * This table must match "enum tr2_sysenv_variable" in tr2_sysenv.h. * * The strings in this table are constant and must match the published * config and environment variable names as described in the documentation. * * We do not define entries for the GIT_TRACE2_PARENT_* environment * variables because they are transient and used to pass information * from parent to child git processes, rather than settings. */ /* clang-format off */ static struct tr2_sysenv_entry tr2_sysenv_settings[] = …; /* clang-format on */ static int tr2_sysenv_cb(const char *key, const char *value, const struct config_context *ctx UNUSED, void *d UNUSED) { … } /* * Load Trace2 settings from the system config (usually "/etc/gitconfig" * unless we were built with a runtime-prefix). These are intended to * define the default values for Trace2 as requested by the administrator. * * Then override with the Trace2 settings from the global config. */ void tr2_sysenv_load(void) { … } /* * Return the value for the requested Trace2 setting from these sources: * the system config, the global config, and the environment. */ const char *tr2_sysenv_get(enum tr2_sysenv_variable var) { … } /* * Return a friendly name for this setting that is suitable for printing * in an error messages. */ const char *tr2_sysenv_display_name(enum tr2_sysenv_variable var) { … } void tr2_sysenv_release(void) { … }