Skip to content

Commit c0b03e8

Browse files
pks-tgitster
authored andcommitted
config: document read_early_config() and read_very_early_config()
It's not clear what `read_early_config()` and `read_very_early_config()` do differently compared to `repo_read_config()` from just looking at their names. Document both of these in the header file to clarify their intent. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent edc2c92 commit c0b03e8

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

config.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,10 +2234,6 @@ void read_early_config(config_fn_t cb, void *data)
22342234
strbuf_release(&gitdir);
22352235
}
22362236

2237-
/*
2238-
* Read config but only enumerate system and global settings.
2239-
* Omit any repo-local, worktree-local, or command-line settings.
2240-
*/
22412237
void read_very_early_config(config_fn_t cb, void *data)
22422238
{
22432239
struct config_options opts = { 0 };

config.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,18 @@ int git_config_from_blob_oid(config_fn_t fn, const char *name,
192192
void git_config_push_parameter(const char *text);
193193
void git_config_push_env(const char *spec);
194194
int git_config_from_parameters(config_fn_t fn, void *data);
195+
196+
/*
197+
* Read config when the Git directory has not yet been set up. In case
198+
* `the_repository` has not yet been set up, try to discover the Git
199+
* directory to read the configuration from.
200+
*/
195201
void read_early_config(config_fn_t cb, void *data);
202+
203+
/*
204+
* Read config but only enumerate system and global settings.
205+
* Omit any repo-local, worktree-local, or command-line settings.
206+
*/
196207
void read_very_early_config(config_fn_t cb, void *data);
197208

198209
/**

0 commit comments

Comments
 (0)