git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] config: fix suggestion for failed set of multi-valued option

From
René Scharfe <l.s.r@web.de>
Date
Nov 24, 2025, 20:33 UTC
Message-ID
<c09945fe-fee2-47f6-8193-ac60d7245209@web.de>
In-Reply-To
<CADBJ995pDG9R8EJnK5nwWKPWAf-XF5P5KTY+bAx71EhdMvvO6A@mail.gmail.com>

The command "git config set <name> <value>" fails for an option that has multiple values. List the "git config set" flags that can be used, instead of old-style "git config" actions.

Reported-by: Paul Wintz <pwintz@ucsc.edu>
Signed-off-by: René Scharfe <l.s.r@web.de>
---
Resent as a pure patch because I messed up the scissors line.
 builtin/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/config.c b/builtin/config.c
index 75852bd79d..86e0cd77f3 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -985,7 +985,7 @@ static int cmd_config_set(int argc, const char **argv, const char *prefix,
 						     argv[0], comment, value);
 		if (ret == CONFIG_NOTHING_SET)
 			error(_("cannot overwrite multiple values with a single value\n"
-			"       Use a regexp, --add or --replace-all to change %s."), argv[0]);
+			"       Use --value=<pattern>, --append or --all to change %s."), argv[0]);
 	}
 
 	location_options_release(&location_opts);
-- 
2.52.0
Previous: René Scharfe
Message 3 of 3 in “[bug report] erroneous suggestion for "--add" option in `git config set` error message”
  1. Paul WintzNov 20, 2025
  2. René ScharfeNov 24, 2025
  3. config: fix suggestion for failed set of multi-valued optionRené Scharfe, Nov 24, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.