From 7a39741999a5216257b1fbcc847cf0c62c114088 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Tue, 17 May 2011 17:38:52 +0200 Subject: config: define and document exit codes The return codes of git_config_set() and friends are magic numbers right in the source. #define them in cache.h where the functions are declared, and use the constants in the source. Also, mention the resulting exit codes of "git config" in its man page (and complete the list). Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- cache.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index 4e9123b77b..6b967cc6dd 100644 --- a/cache.h +++ b/cache.h @@ -1012,6 +1012,16 @@ extern const char *packed_object_info_detail(struct packed_git *, off_t, unsigne /* Dumb servers support */ extern int update_server_info(int); +/* git_config_parse_key() returns these negated: */ +#define CONFIG_INVALID_KEY 1 +#define CONFIG_NO_SECTION_OR_NAME 2 +/* git_config_set(), git_config_set_multivar() return the above or these: */ +#define CONFIG_NO_LOCK -1 +#define CONFIG_INVALID_FILE 3 +#define CONFIG_NO_WRITE 4 +#define CONFIG_NOTHING_SET 5 +#define CONFIG_INVALID_PATTERN 6 + typedef int (*config_fn_t)(const char *, const char *, void *); extern int git_default_config(const char *, const char *, void *); extern int git_config_from_file(config_fn_t fn, const char *, void *); -- cgit v1.2.3