Git development
 help / color / mirror / Atom feed
* git config problem with strange config files
@ 2007-12-31 17:47 Peter Oberndorfer
  2008-01-01  6:17 ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Oberndorfer @ 2007-12-31 17:47 UTC (permalink / raw)
  To: Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 947 bytes --]

Hi,

In case of a strange .git/config file "git config key value" can create a 
bogus config entry, where one old value is wrong and the new value resides in 
the wrong section until the config file is fixed up by hand

The attached test config has a trailing tab in the last line
and no newline after that.
When git config is run the new section name is placed directly after the 
trailing tab, which corrupts the old value.

To reproduce  the error do the following:

mkdir git_test_config && cd git_test_config
git init
<copy the attached config file to .git/config>
git config section2.key bar
git config --get section2.key
-> returns nothing
git config --get section.key
-> foo [section2]
-> error: More than one value for the key section.key: bar

i tried to make a test out of this but i failed to create a config file 
without a trailing newline using here documents :-(

Tested using v1.5.4.rc2 and v1.5.4-rc2-6-gab11903

Greetings Peter

[-- Attachment #2: config --]
[-- Type: text/plain, Size: 21 bytes --]

[section]
	key = foo	

[-- Attachment #3: config_bogus --]
[-- Type: text/plain, Size: 43 bytes --]

[section]
	key = foo	[section2]
	key = bar

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-01 19:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-31 17:47 git config problem with strange config files Peter Oberndorfer
2008-01-01  6:17 ` Jeff King
2008-01-01  6:23   ` Jeff King
2008-01-01 19:57     ` Junio C Hamano
2008-01-01 14:25   ` Peter Oberndorfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox