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

[PATCH] git-config: don't silently ignore options after --list

From
Frank Lichtenheld <frank@lichtenheld.de>
Date
Oct 5, 2007, 20:16 UTC
Message-ID
<1191615404-32244-1-git-send-email-frank@lichtenheld.de>

Error out if someone gives options after --list since that is not a valid syntax.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
 builtin-config.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
 Two minutes of my life I don't get back ;)
diff --git a/builtin-config.c b/builtin-config.c
index 0a605e0..cb7e9e9 100644
--- a/builtin-config.c
+++ b/builtin-config.c
@@ -172,8 +172,11 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 			type = T_INT;
 		else if (!strcmp(argv[1], "--bool"))
 			type = T_BOOL;
-		else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l"))
+		else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l")) {
+			if (argc != 2)
+				usage(git_config_set_usage);
 			return git_config(show_all_config);
+		}
 		else if (!strcmp(argv[1], "--global")) {
 			char *home = getenv("HOME");
 			if (home) {
-- 
1.5.3.4
Message 1 of 1 in “git-config: don't silently ignore options after --list”
  1. git-config: don't silently ignore options after --listFrank Lichtenheld, Oct 5, 2007

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.