threads / discuss / 50909

repeated empty section in config of repository

Subject: repeated empty section in config of repository

## tl;dr

3 messages between Apr 10, 2019 and Apr 10, 2019.

replies: 2people: 3as markdown or json

Kurt Ablinger· Apr 10, 2019, 11:51 UTC · lore
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· Apr 10, 2019, 14:57 UTC · re: Kurt Ablinger · lore

Re: repeated empty section in config of repository

On Wed, Apr 10, 2019 at 11:51:03AM +0000, Kurt Ablinger wrote:
Show 21 quoted lines
> 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· Apr 10, 2019, 16:35 UTC · re: Kurt Ablinger · lore

Re: repeated empty section in config of repository

On Wed, Apr 10, 2019 at 9:08 AM Kurt Ablinger <kurt.ablinger@bs-ag.com> wrote:
Show 25 quoted lines
>
> 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.

← back to recent threads