path: root/t/
diff options
authorLinus Torvalds <>2006-05-09 19:24:02 (GMT)
committerJunio C Hamano <>2006-05-13 21:00:16 (GMT)
commitd14f776402d9f7040cc71ff6e3b992b2e019526a (patch)
treea047cb0c911b3bad3504861341fb1971503c697c /t/
parentbdf0ef0824ecca427ec04ac047ffe4aaf73ace5a (diff)
git config syntax updates
This updates the hierarchical section name syntax to [section<space>+"<randomstring>"] where the only rule for "randomstring" is that it can't contain a newline, and if you really want to insert a double-quote, you do it with \". It turns that into the section name "secion.randomstring". The "section" part is still case insensitive, but the "randomstring" part is case sensitive. So you could use this for things like [email ""] name = Linus Torvalds if you wanted to do the "email->name" conversion as part of the config file format (I'm not claiming that is sensible, I'm just giving it as an insane example). That would show up as the association -> Linus Torvalds which is easy to parse (the "." in the email _looks_ ambiguous, but it isn't: you know that there will always be a single key-name, so you find the key name with "strrchr(name, '.')" and things are entirely unambiguous). Repo-config is updated to be able to parse the new format, and also write things out in the new format. [jc: rolled two patches from Linus and one fix-up from Sean into one, with additional adjustments for t/t1300 test to check the case insensitiveness of section base and variable and case sensitiveness of the extended section part. Then stripped some part off to make the result applicable to the stale 1.3.X series that does not have recent enhancements. ] Signed-off-by: Linus Torvalds <> Signed-off-by: Sean Estabrooks <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/')
1 files changed, 3 insertions, 3 deletions
diff --git a/t/ b/t/
index ab4dd5c..028d159 100755
--- a/t/
+++ b/t/
@@ -229,7 +229,7 @@ test_expect_failure 'invalid key' 'git-repo-config inval.2key blabla'
test_expect_success 'correct key' 'git-repo-config 123456.a123 987'
test_expect_success 'hierarchical section' \
- 'git-repo-config 1.2.3.alpha beta'
+ 'git-repo-config Version.1.2.3eX.Alpha beta'
cat > expect << EOF
[beta] ; silly comment # another comment
@@ -241,8 +241,8 @@ noIndent= sillyValue ; 'nother silly comment
NoNewLine = wow2 for me
a123 = 987
- alpha = beta
+[Version "1.2.3eX"]
+ Alpha = beta
test_expect_success 'hierarchical section value' 'cmp .git/config expect'