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

Make git config variable names case-insensitive

From
Linus Torvalds <torvalds@osdl.org>
Date
Oct 12, 2005, 01:09 UTC
Message-ID
<Pine.LNX.4.64.0510111803540.14597@g5.osdl.org>

They always were meant to be case-insensitive, but I had missed one "tolower()", making that not true.

The actual _values_ aren't case-insensitive, of course, although some uses of them may be (ie boolean parsing uses "strcasecmp()" to match against the strings "true" and "false").

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---

This should independent of the other patch - it should apply whether you've taken the [user]name/email config thing or not. But it was generated on top of that change.

diff --git a/config.c b/config.c
index cf80358..9b7c6f2 100644
--- a/config.c
+++ b/config.c
@@ -168,7 +168,7 @@ static int git_parse_file(config_fn_t fn
 		}
 		if (!isalpha(c))
 			break;
-		var[baselen] = c;
+		var[baselen] = tolower(c);
 		if (get_value(fn, var, baselen+1) < 0)
 			break;
 	}
Message 1 of 1 in “Make git config variable names case-insensitive”
  1. Linus TorvaldsOct 12, 2005

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.