From: Peter Oberndorfer <kumbayo84@arcor.de>
To: Git Mailing List <git@vger.kernel.org>
Subject: git config problem with strange config files
Date: Mon, 31 Dec 2007 18:47:41 +0100 [thread overview]
Message-ID: <200712311847.41499.kumbayo84@arcor.de> (raw)
[-- 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
next reply other threads:[~2007-12-31 17:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-31 17:47 Peter Oberndorfer [this message]
2008-01-01 6:17 ` git config problem with strange config files Jeff King
2008-01-01 6:23 ` Jeff King
2008-01-01 19:57 ` Junio C Hamano
2008-01-01 14:25 ` Peter Oberndorfer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200712311847.41499.kumbayo84@arcor.de \
--to=kumbayo84@arcor.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox