Re: [BUG] git config does not reuse section name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, 7 Dec 2009, Junio C Hamano wrote:

> Yakup Akbay <yakbay@xxxxxxxxxx> writes:
> 
> > When I repeat the following n times
> >
> >    $ git config color.ui always
> >    $ git config --unset color.ui
> >
> >
> > it ends up the section name [color] n times in the .git/config file.
> >
> >
> >
> > like this for n=4:
> >
> >    [color]
> >    [color]
> >    [color]
> >    [color]
> >
> >
> > Using git version 1.6.5.3 (I don't know whether this is already fixed
> > in in later versions)
> 
> If I recall correctly, this hasn't been even noticed/reported/recognized
> as an issue, ever since the "git repo-config" was introduced (which later
> was renamed to "git config").  Dscho, do you remember details?

IIRC, due to technical limitations, the config machinery only recognizes 
sections if there is at least _one_ entry in them.  This is because 
git_config() is used to determine (from the current file position) where 
the section begins.

And likewise, due to those technical limitations, the section header is 
not removed when the last entry in the section is removed (this was 
because I did not want to change the location of the section, but due to 
the mentioned limitation, that did not work out).

Ciao,
Dscho

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]