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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Sep 12, 2024 at 13:29 UTC
c0b03e8b6d9361277557ac93b23980d7fe6e751b
2 files changed
+11
-4
config.c
-4
@@ -2234,10 +2234,6 @@ void read_early_config(config_fn_t cb, void *data)
2234
strbuf_release(&gitdir);
2235
}
2236
2237
-/*
2238
- * Read config but only enumerate system and global settings.
2239
- * Omit any repo-local, worktree-local, or command-line settings.
2240
- */
2237
void read_very_early_config(config_fn_t cb, void *data)
2238
{
2239
struct config_options opts = { 0 };
config.h
+11
@@ -192,7 +192,18 @@ int git_config_from_blob_oid(config_fn_t fn, const char *name,
192
void git_config_push_parameter(const char *text);
193
void git_config_push_env(const char *spec);
194
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
+ */
201
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
+ */
207
void read_very_early_config(config_fn_t cb, void *data);
208
209
/**