Merge branch 'jk/config-include'

* jk/config-include:
  : An assignment to the include.path pseudo-variable causes the named file
  : to be included in-place when Git looks up configuration variables.
  config: add include directive
  config: eliminate config_exclusive_filename
  config: stop using config_exclusive_filename
  config: provide a version of git_config with more options
  config: teach git_config_rename_section a file argument
  config: teach git_config_set_multivar_in_file a default path
  config: copy the return value of prefix_filename
  t1300: add missing &&-chaining
  docs/api-config: minor clarifications
  docs: add a basic description of the config API
This commit is contained in:
Junio C Hamano
2012-02-23 13:30:14 -08:00
8 changed files with 495 additions and 60 deletions

11
cache.h
View File

@ -1115,6 +1115,8 @@ extern int git_config_from_file(config_fn_t fn, const char *, void *);
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, 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 *);
extern int git_config_int(const char *, const char *);
@ -1130,6 +1132,7 @@ extern int git_config_parse_key(const char *, char **, int *);
extern int git_config_set_multivar(const char *, const char *, const char *, int);
extern int git_config_set_multivar_in_file(const char *, const char *, const char *, const char *, int);
extern int git_config_rename_section(const char *, const char *);
extern int git_config_rename_section_in_file(const char *, const char *, const char *);
extern const char *git_etc_gitconfig(void);
extern int check_repository_format_version(const char *var, const char *value, void *cb);
extern int git_env_bool(const char *, int);
@ -1140,7 +1143,13 @@ extern const char *get_commit_output_encoding(void);
extern int git_config_parse_parameter(const char *, config_fn_t fn, void *data);
extern const char *config_exclusive_filename;
struct config_include_data {
int depth;
config_fn_t fn;
void *data;
};
#define CONFIG_INCLUDE_INIT { 0 }
extern int git_config_include(const char *name, const char *value, void *data);
#define MAX_GITNAME (1000)
extern char git_default_email[MAX_GITNAME];