Re: Minor bug: git config ignores empty sections

2016-08-21 Thread Jakub Narębski
W dniu 16.08.2016 o 14:36, Jeff King pisze: > What I think would be much more sane in general is to parse the whole > thing into a tree (or even a flat list of events), List of events is cheaper on memory (though I don't think there is an issue with size of config file), and can be turned into

Re: Minor bug: git config ignores empty sections

2016-08-16 Thread Jeff King
On Tue, Aug 16, 2016 at 12:06:56AM -0400, Eli Barzilay wrote: > So it sounds like removing an empty header is problematic in most cases, > but adding a new variable to an existing empty header should not be...? I think it's less problematic, though there are still some funny cases. Like:

Re: Minor bug: git config ignores empty sections

2016-08-15 Thread Eli Barzilay
On Mon, Aug 15, 2016 at 2:55 PM, Jeff King wrote: > On Mon, Aug 15, 2016 at 11:28:20AM -0700, Junio C Hamano wrote: > >> I notice that we have thought about all the issues when we last >> discussed it in 2013. Refining a message from the earlier thread, >> as it illustrates tricky

Re: Minor bug: git config ignores empty sections

2016-08-15 Thread Junio C Hamano
Jeff King writes: >> So a comment outside [section "name"] is tricky; it needs some >> mechanism (or convention) to tell us if it is about the particular >> section, or it is about the location in the configuration file. > > Keep in mind that even "outside" is hard, because

Re: Minor bug: git config ignores empty sections

2016-08-15 Thread Jeff King
On Mon, Aug 15, 2016 at 11:28:20AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > On Mon, Aug 15, 2016 at 07:34:50PM +0200, Andreas Schwab wrote: > > > >> On Aug 15 2016, Jeff King wrote: > >> > >> > And implicit in your test is the other bug, which is

Re: Minor bug: git config ignores empty sections

2016-08-15 Thread Andreas Schwab
On Aug 15 2016, Junio C Hamano wrote: > If we were to remove the section header at this point, we should > be removing the comment two out of three cases. > > - if it is about section.key, it should go when section.key goes. > - if it is about section, it should go when

Re: Minor bug: git config ignores empty sections

2016-08-15 Thread Junio C Hamano
Jeff King writes: > On Mon, Aug 15, 2016 at 07:34:50PM +0200, Andreas Schwab wrote: > >> On Aug 15 2016, Jeff King wrote: >> >> > And implicit in your test is the other bug, which is that deleting the >> > last key in a section leaves the empty header. I think

Re: Minor bug: git config ignores empty sections

2016-08-15 Thread Jeff King
On Mon, Aug 15, 2016 at 07:34:50PM +0200, Andreas Schwab wrote: > On Aug 15 2016, Jeff King wrote: > > > And implicit in your test is the other bug, which is that deleting the > > last key in a section leaves the empty header. I think it's related to > > the same issue. > >

Re: Minor bug: git config ignores empty sections

2016-08-15 Thread Junio C Hamano
Eli Barzilay writes: > Looks like there's a problem with setting a config with an empty > section, making it create a new section. The result is: Thanks; this unfortunately is a well-known issue, that once was even (supposed to be) a part of GSoC project but hasn't been

Re: Minor bug: git config ignores empty sections

2016-08-15 Thread Andreas Schwab
On Aug 15 2016, Jeff King wrote: > And implicit in your test is the other bug, which is that deleting the > last key in a section leaves the empty header. I think it's related to > the same issue. Indiscriminately removing empty section headers may break comments that have been

Re: Minor bug: git config ignores empty sections

2016-08-15 Thread Jeff King
On Sun, Aug 14, 2016 at 09:29:27PM -0400, Eli Barzilay wrote: > Looks like there's a problem with setting a config with an empty > section, making it create a new section. The result is: > > $ git --version > git version 2.9.2 > $ git init > Initialized empty Git repository in

Minor bug: git config ignores empty sections

2016-08-14 Thread Eli Barzilay
Looks like there's a problem with setting a config with an empty section, making it create a new section. The result is: $ git --version git version 2.9.2 $ git init Initialized empty Git repository in /home/eli/t/.git/ $ t() { git config x.y x; git config --unset x.y; }