@@ -126,6 +126,8 @@ int git_default_config(const char *, const char *, void *);
126
126
/**
127
127
* Read a specific file in git-config format.
128
128
* This function takes the same callback and data parameters as `git_config`.
129
+ *
130
+ * Unlike git_config(), this function does not respect includes.
129
131
*/
130
132
int git_config_from_file (config_fn_t fn , const char * , void * );
131
133
@@ -158,6 +160,8 @@ void read_very_early_config(config_fn_t cb, void *data);
158
160
* will first feed the user-wide one to the callback, and then the
159
161
* repo-specific one; by overwriting, the higher-priority repo-specific
160
162
* value is left at the end).
163
+ *
164
+ * Unlike git_config_from_file(), this function respects includes.
161
165
*/
162
166
void git_config (config_fn_t fn , void * );
163
167
@@ -338,39 +342,6 @@ const char *current_config_origin_type(void);
338
342
const char * current_config_name (void );
339
343
int current_config_line (void );
340
344
341
- /**
342
- * Include Directives
343
- * ------------------
344
- *
345
- * By default, the config parser does not respect include directives.
346
- * However, a caller can use the special `git_config_include` wrapper
347
- * callback to support them. To do so, you simply wrap your "real" callback
348
- * function and data pointer in a `struct config_include_data`, and pass
349
- * the wrapper to the regular config-reading functions. For example:
350
- *
351
- * -------------------------------------------
352
- * int read_file_with_include(const char *file, config_fn_t fn, void *data)
353
- * {
354
- * struct config_include_data inc = CONFIG_INCLUDE_INIT;
355
- * inc.fn = fn;
356
- * inc.data = data;
357
- * return git_config_from_file(git_config_include, file, &inc);
358
- * }
359
- * -------------------------------------------
360
- *
361
- * `git_config` respects includes automatically. The lower-level
362
- * `git_config_from_file` does not.
363
- *
364
- */
365
- struct config_include_data {
366
- int depth ;
367
- config_fn_t fn ;
368
- void * data ;
369
- const struct config_options * opts ;
370
- };
371
- #define CONFIG_INCLUDE_INIT { 0 }
372
- int git_config_include (const char * name , const char * value , void * data );
373
-
374
345
/*
375
346
* Match and parse a config key of the form:
376
347
*
0 commit comments