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

[PATCH] Allow git config files to use keys containing the hyphen character '-'

From
Tthadh@google.com <thadh@google.com>
Date
Mar 28, 2008, 23:15 UTC
Message-ID
<1206746133-25974-1-git-send-email-thadh@google.com>
From: Thad Hughes <thadh@thad.corp.google.com>
---
 .../src/org/spearce/jgit/lib/RepositoryConfig.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
index 78ceba7..42b2c5d 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
@@ -496,7 +496,10 @@ public class RepositoryConfig {
 					}
 				}
 				break;
-			} else if (Character.isLetterOrDigit((char) c)) {
+			} else if (Character.isLetterOrDigit((char) c) || c == '-') {
+				// From the git-config man page: 
+				//     The variable names are case-insensitive and only 
+				//     alphanumeric characters and - are allowed.
 				name.append((char) c);
 			} else if ('\n' == c) {
 				r.reset();
-- 
1.5.4.2.156.ge3c5
Message 1 of 1 in “Allow git config files to use keys containing the hyphen character '-'”
  1. Allow git config files to use keys containing the hyphen character '-'thadh@google.com, Mar 28, 2008

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.