[I didn't follow all previous discussion, so feel free to ignore me if this has been discussed already]
Is it really necessary to normalize keys on each lookup? The current git config code simply does a 'strcmp("lower-case-key", var)' so normalization shouldn't be necessary for the majority of callers. If a caller uses a non-constant key (e.g. as passed to 'git config --get <name>'), it would be the caller's responsibility to normalize.[...]
I would have expected '..._get_string' to return a string. If the return value indicates whether something was found, it should probably be called '..._find_...'?
In the end, you want typed config functions that do type conversion and handle parse errors, at least for the common types bool/int/string... Thus the generic function that returns unparsed data should probably be called '..._value', not '..._string'?
A typical pull-style config API will also let you specify default values, e.g.:
const char *git_config_get_string(const char *key, const char *default_value)
{
const char *value;
if (!git_config_find_value(key, &value))
return default_value;
if (!value)
config_error_nonbool();
return value;
} int git_config_get_bool(const char *key, int default_value)
{
const char *value;
if (!git_config_find_value(key, &value))
return default_value;
return git_config_bool(key, value);
}