From c8985ce05360857733738561dd6cdf964470cbdf Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Wed, 19 Feb 2014 00:58:54 +0200 Subject: config: change git_config_with_options() interface We're going to have more options for config source. Let's alter git_config_with_options() interface to accept struct with all source options. Signed-off-by: Kirill A. Shutemov Signed-off-by: Junio C Hamano --- cache.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cache.h') diff --git a/cache.h b/cache.h index dc040fb1aa..9d94bd69f7 100644 --- a/cache.h +++ b/cache.h @@ -1146,6 +1146,11 @@ extern int update_server_info(int); #define CONFIG_INVALID_PATTERN 6 #define CONFIG_GENERIC_ERROR 7 +struct git_config_source { + const char *file; + const char *blob; +}; + 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 *); @@ -1155,8 +1160,7 @@ extern void git_config_push_parameter(const char *text); extern int git_config_from_parameters(config_fn_t fn, void *data); extern int git_config(config_fn_t fn, void *); extern int git_config_with_options(config_fn_t fn, void *, - const char *filename, - const char *blob_ref, + struct git_config_source *config_source, int respect_includes); extern int git_config_early(config_fn_t fn, void *, const char *repo_config); extern int git_parse_ulong(const char *, unsigned long *); -- cgit v1.2.3 From 3caec73b5568341c5d8f303692423a8e9fb0cb39 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Wed, 19 Feb 2014 00:58:55 +0200 Subject: config: teach "git config --file -" to read from the standard input The patch extends git config --file interface to allow read config from stdin. Editing stdin or setting value in stdin is an error. Include by absolute path is allowed in stdin config, but not by relative path. Signed-off-by: Kirill A. Shutemov Signed-off-by: Junio C Hamano --- cache.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index 9d94bd69f7..4db19b5370 100644 --- a/cache.h +++ b/cache.h @@ -1147,6 +1147,7 @@ extern int update_server_info(int); #define CONFIG_GENERIC_ERROR 7 struct git_config_source { + unsigned int use_stdin:1; const char *file; const char *blob; }; -- cgit v1.2.3