]> git.ipfire.org Git - thirdparty/git.git/commitdiff
config: add 'gently' parameter to format_config()
authorDerrick Stolee <stolee@gmail.com>
Mon, 23 Feb 2026 12:26:44 +0000 (12:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 Feb 2026 21:23:40 +0000 (13:23 -0800)
This parameter is set to 0 for all current callers and is UNUSED.
However, we will start using this option in future changes and in a
critical change that requires gentle parsing (not using die()) to try
parsing all values in a list.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/config.c

index 237f7a934d2f120aec7ba5dc270de7049d44a806..b4c4228311dde15d48e83bfcd9319e37f4397ec3 100644 (file)
@@ -242,10 +242,14 @@ struct strbuf_list {
  * append it into strbuf `buf`.  Returns a negative value on failure,
  * 0 on success, 1 on a missing optional value (i.e., telling the
  * caller to pretend that <key_,value_> did not exist).
+ *
+ * Note: 'gently' is currently ignored, but will be implemented in
+ * a future change.
  */
 static int format_config(const struct config_display_options *opts,
                         struct strbuf *buf, const char *key_,
-                        const char *value_, const struct key_value_info *kvi)
+                        const char *value_, const struct key_value_info *kvi,
+                        int gently UNUSED)
 {
        if (opts->show_scope)
                show_config_scope(opts, kvi, buf);
@@ -372,7 +376,7 @@ static int collect_config(const char *key_, const char *value_,
        strbuf_init(&values->items[values->nr], 0);
 
        status = format_config(data->display_opts, &values->items[values->nr++],
-                              key_, value_, kvi);
+                              key_, value_, kvi, 0);
        if (status < 0)
                return status;
        if (status) {
@@ -463,7 +467,7 @@ static int get_value(const struct config_location_options *opts,
                strbuf_init(item, 0);
 
                status = format_config(display_opts, item, key_,
-                                      display_opts->default_value, &kvi);
+                                      display_opts->default_value, &kvi, 0);
                if (status < 0)
                        die(_("failed to format default config value: %s"),
                            display_opts->default_value);
@@ -743,7 +747,7 @@ static int get_urlmatch(const struct config_location_options *opts,
 
                status = format_config(&display_opts, &buf, item->string,
                                       matched->value_is_null ? NULL : matched->value.buf,
-                                      &matched->kvi);
+                                      &matched->kvi, 0);
                if (!status)
                        fwrite(buf.buf, 1, buf.len, stdout);
                strbuf_release(&buf);