# repeated empty section in config of repository

3 messages from 2019-04-10 to 2019-04-10. Participants: Kurt Ablinger, SZEDER Gábor, Elijah Newren.
Thread: https://gitlist.dev/t/50909

## Kurt Ablinger, 2019-04-10 11:51

Subject: repeated empty section in config of repository
Message-ID: <32db4d5189264ab791704cce91d6efaf@bs-ag.com>
URL: https://gitlist.dev/e/32db4d5189264ab791704cce91d6efaf%40bs-ag.com

```
Hello, 

I am not sure if this can be problem - at least it is proably not correct:

when adding a key to an empty section and deleting the key so that the section is empty again,
every add adds the section-name again - example:

git config gc.autoDetach false ; git config --unset gc.autoDetach ; cat config
[gc]

git config gc.autoDetach false ; git config --unset gc.autoDetach ; cat config
[gc]
[gc]

git config gc.autoDetach false ; git config --unset gc.autoDetach ; cat config
[gc]
[gc]
[gc]

Git-version is 2.17.0
Linux - Cent/OS: 2.6.32-754.10.1.el6.x86_64 - GNU/Linux

Greetings
Kurt


```

## SZEDER Gábor, 2019-04-10 14:57

Subject: Re: repeated empty section in config of repository
Message-ID: <20190410145721.GI8796@szeder.dev>
URL: https://gitlist.dev/e/20190410145721.GI8796%40szeder.dev
In-Reply-To: <32db4d5189264ab791704cce91d6efaf@bs-ag.com>

```
On Wed, Apr 10, 2019 at 11:51:03AM +0000, Kurt Ablinger wrote:
> Hello, 
> 
> I am not sure if this can be problem - at least it is proably not correct:
> 
> when adding a key to an empty section and deleting the key so that the section is empty again,
> every add adds the section-name again - example:
> 
> git config gc.autoDetach false ; git config --unset gc.autoDetach ; cat config
> [gc]
> 
> git config gc.autoDetach false ; git config --unset gc.autoDetach ; cat config
> [gc]
> [gc]
> 
> git config gc.autoDetach false ; git config --unset gc.autoDetach ; cat config
> [gc]
> [gc]
> [gc]
> 
> Git-version is 2.17.0
> Linux - Cent/OS: 2.6.32-754.10.1.el6.x86_64 - GNU/Linux

This was a known issue, but not a serious one, in the sense that it
didn't affect correctness of configuration parsing.

It was mostly fixed in v2.18.0.



```

## Elijah Newren, 2019-04-10 16:35

Subject: Re: repeated empty section in config of repository
Message-ID: <CABPp-BEvsBqqQMvb8zAPZ8r+=Wd-2VA0eVuM9FJSoogUP=AZOA@mail.gmail.com>
URL: https://gitlist.dev/e/CABPp-BEvsBqqQMvb8zAPZ8r%2B%3DWd-2VA0eVuM9FJSoogUP%3DAZOA%40mail.gmail.com
In-Reply-To: <32db4d5189264ab791704cce91d6efaf@bs-ag.com>

```
On Wed, Apr 10, 2019 at 9:08 AM Kurt Ablinger <kurt.ablinger@bs-ag.com> wrote:
>
> Hello,
>
> I am not sure if this can be problem - at least it is proably not correct:
>
> when adding a key to an empty section and deleting the key so that the section is empty again,
> every add adds the section-name again - example:
>
> git config gc.autoDetach false ; git config --unset gc.autoDetach ; cat config
> [gc]
>
> git config gc.autoDetach false ; git config --unset gc.autoDetach ; cat config
> [gc]
> [gc]
>
> git config gc.autoDetach false ; git config --unset gc.autoDetach ; cat config
> [gc]
> [gc]
> [gc]
>
> Git-version is 2.17.0
> Linux - Cent/OS: 2.6.32-754.10.1.el6.x86_64 - GNU/Linux
>
> Greetings
> Kurt

I believe this was fixed by 4f4d0b42bae8 ("Merge branch
'js/empty-config-section-fix'", 2018-05-08) in git-2.18.0.

```
