diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-02-04 10:24:50 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-02-04 10:24:50 -0800 |
commit | 099ba556d05571001293c8eda10a4fc659f83f48 (patch) | |
tree | a7eb1760f82fdd9f769ea6a64e6ece7198ef471c /cache.h | |
parent | 149a4211a4b8d8bbcdd72685d538d6ac7365e29e (diff) | |
parent | b3873c336cc2eb5a6eb2b10981a2ca0b65b8c987 (diff) | |
download | git-099ba556d05571001293c8eda10a4fc659f83f48.tar.gz |
Merge branch 'jk/config-parsing-cleanup'
Configuration parsing for tar.* configuration variables were
broken. Introduce a new config-keyname parser API to make the
callers much less error prone.
* jk/config-parsing-cleanup:
reflog: use parse_config_key in config callback
help: use parse_config_key for man config
submodule: simplify memory handling in config parsing
submodule: use parse_config_key when parsing config
userdiff: drop parse_driver function
convert some config callbacks to parse_config_key
archive-tar: use parse_config_key when parsing config
config: add helper function for parsing key names
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1170,6 +1170,21 @@ struct config_include_data { #define CONFIG_INCLUDE_INIT { 0 } extern int git_config_include(const char *name, const char *value, void *data); +/* + * Match and parse a config key of the form: + * + * section.(subsection.)?key + * + * (i.e., what gets handed to a config_fn_t). The caller provides the section; + * we return -1 if it does not match, 0 otherwise. The subsection and key + * out-parameters are filled by the function (and subsection is NULL if it is + * missing). + */ +extern int parse_config_key(const char *var, + const char *section, + const char **subsection, int *subsection_len, + const char **key); + extern int committer_ident_sufficiently_given(void); extern int author_ident_sufficiently_given(void); |