{"thread":{"id":"31881","subject":"git config --unset does not remove section","startedAt":"2012-10-21T06:46:10Z","lastAt":"2012-10-21T07:09:20Z","messageCount":2,"participants":["Angelo Borsotti","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"201619","messageId":"CAB9Jk9C_b_PScm3vEdvxsjqNHpTbz7OTTdFeFey7Sdb+M5gYFw@mail.gmail.com","threadId":"31881","inReplyTo":null,"subject":"git config --unset does not remove section","fromName":"Angelo Borsotti","fromEmail":"angelo.borsotti@gmail.com","sentAt":"2012-10-21T06:46:10Z","receivedAt":"2012-10-21T06:46:10Z","isPatch":false,"sender":{"key":"angelo.borsotti@gmail.com","avatar":null},"body":"Hello,\n\ngit config --unset does not remove the section in the configuration\nfile when the removed key is the last one, leaving then an empty\nsection that is lo longer used. E.g.:\n\n    git config foo.bar true\n\ncreates:\n\n    [foo]\n\tbar = true\n\nthen:\n\n    git config --unset foo.bar\n\nchanges the section into:\n\n    [foo]\n\nAnother git config foo.bar true changes the config file into:\n\n    [foo]\n    [foo]\n\tbar = true\n\nHaving two sections with the same name clutters the config file.\n\n-Angelo Borsotti\n"},{"id":"201621","messageId":"7v3918gv33.fsf@alter.siamese.dyndns.org","threadId":"31881","inReplyTo":"CAB9Jk9C_b_PScm3vEdvxsjqNHpTbz7OTTdFeFey7Sdb+M5gYFw@mail.gmail.com","subject":"Re: git config --unset does not remove section","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-21T07:09:20Z","receivedAt":"2012-10-21T07:09:20Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Angelo Borsotti <angelo.borsotti@gmail.com> writes:\n\n> Another git config foo.bar true changes the config file into:\n>\n>     [foo]\n>     [foo]\n> \tbar = true\n>\n> Having two sections with the same name clutters the config file.\n\nTrue.  It would be nice if the removal of the last element removes\nthe section header as well.\n"}]}