From: "Sverre Rabbelier" <alturin@gmail.com>
To: "Git Mailinglist" <git@vger.kernel.org>
Subject: git config oddity
Date: Tue, 15 Jul 2008 16:44:51 +0200 [thread overview]
Message-ID: <bd6139dc0807150744l78eb8d54ld167d3a9a5a600f@mail.gmail.com> (raw)
Heya,
I noticed today that when unsetting the last value in a group git
config leaves the empty group header. I was somewhat surprised here,
but I am guessing it has a purpose? Anyway, I also noticed (and this
threw my manual config parser off) that when later on an option is set
to that empty group, a new group is created with the same name. Is
this something I have to deal with in my parser (e.g., should I keep
scanning the file for occurrences of my header and allow for empty
groups, or is this a bug in git config? Either is fine with me, was
just wondering :).
-----------------
sverre@Laptop-Sverre:~/code$ mkdir config-oddity
sverre@Laptop-Sverre:~/code$ cd config-oddity/
sverre@Laptop-Sverre:~/code/config-oddity$ git init
Initialized empty Git repository in /home/sverre/code/config-oddity/.git/
sverre@Laptop-Sverre:~/code/config-oddity$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
sverre@Laptop-Sverre:~/code/config-oddity$ git config foo.bar spam
sverre@Laptop-Sverre:~/code/config-oddity$ cat .git/config # as expected
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[foo]
bar = spam
sverre@Laptop-Sverre:~/code/config-oddity$ git config --unset foo.bar
sverre@Laptop-Sverre:~/code/config-oddity$ cat .git/config # dubious,
but acceptable
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[foo]
sverre@Laptop-Sverre:~/code/config-oddity$ git config foo.bar eggs
sverre@Laptop-Sverre:~/code/config-oddity$ cat .git/config # errr? two
[foo] headers?
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[foo]
[foo]
bar = eggs
sverre@Laptop-Sverre:~/code/config-oddity$
-----------------
--
Cheers,
Sverre Rabbelier
next reply other threads:[~2008-07-15 14:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-15 14:44 Sverre Rabbelier [this message]
2008-07-15 15:02 ` git config oddity Johannes Schindelin
2008-07-15 15:29 ` Sverre Rabbelier
2008-07-15 15:33 ` Johannes Schindelin
2008-07-15 15:35 ` Sverre Rabbelier
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=bd6139dc0807150744l78eb8d54ld167d3a9a5a600f@mail.gmail.com \
--to=alturin@gmail.com \
--cc=git@vger.kernel.org \
--cc=sverre@rabbelier.nl \
/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