]> git.ipfire.org Git - thirdparty/git.git/commitdiff
config: document `read_early_config()` and `read_very_early_config()`
authorPatrick Steinhardt <ps@pks.im>
Thu, 12 Sep 2024 11:29:43 +0000 (13:29 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Sep 2024 17:15:40 +0000 (10:15 -0700)
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>
config.c
config.h

index 0b87f0f90507b7a3391c4803166df2c9ba122d49..a8357ea9544ad978be02a9016be403523c7e64f8 100644 (file)
--- a/config.c
+++ b/config.c
@@ -2234,10 +2234,6 @@ void read_early_config(config_fn_t cb, void *data)
        strbuf_release(&gitdir);
 }
 
-/*
- * Read config but only enumerate system and global settings.
- * Omit any repo-local, worktree-local, or command-line settings.
- */
 void read_very_early_config(config_fn_t cb, void *data)
 {
        struct config_options opts = { 0 };
index d0497157c52f576bbd7bcceda7739a28a576c6c3..f5fa833cb98521f6accb81a457ec78a1d0141009 100644 (file)
--- a/config.h
+++ b/config.h
@@ -192,7 +192,18 @@ int git_config_from_blob_oid(config_fn_t fn, const char *name,
 void git_config_push_parameter(const char *text);
 void git_config_push_env(const char *spec);
 int git_config_from_parameters(config_fn_t fn, void *data);
+
+/*
+ * Read config when the Git directory has not yet been set up. In case
+ * `the_repository` has not yet been set up, try to discover the Git
+ * directory to read the configuration from.
+ */
 void read_early_config(config_fn_t cb, void *data);
+
+/*
+ * Read config but only enumerate system and global settings.
+ * Omit any repo-local, worktree-local, or command-line settings.
+ */
 void read_very_early_config(config_fn_t cb, void *data);
 
 /**