[RFC] Using Git's internal config system

John Keeping john at keeping.me.uk
Wed Jun 5 13:15:11 CEST 2013


On Wed, Jun 05, 2013 at 12:52:57PM +0200, Lukas Fleischer wrote:
> On Wed, Jun 05, 2013 at 11:26:53AM +0100, John Keeping wrote:
> > On Wed, Jun 05, 2013 at 12:06:58PM +0200, Lukas Fleischer wrote:
> > [...]
> > > 
> > > * We need to find an alternate syntax for "repo.module-link.name =
> > >   value". As far as I know, Git does not support nested sections. Does
> > >   anybody have an idea how to do this? We need something like:
> > > 
> > >     [repo "foo"]
> > >         url = foo.git
> > >         path = /some/path/to/foo/
> > >         desc = Foo repository
> > > 	[module-link "path1"]
> > >             format = formatstring1
> > > 	[module-link "path2"]
> > >             format = formatstring2
> > > 
> > >   Maybe just use "module-link = " and allow delimiters to specify pairs
> > >   of paths and corresponding format strings?
> > > 
> > > * How do we support "section = " statements? Basically the same issue.
> > 
> > We could just support that using ordering like we currently do.  So when
> > you hit a "section.name" entry we switch section.  Since Git's parser
> > just uses callbacks that should be fairly easy to implement.
> 
> Unfortunately, it is not that simple. With the new syntax, elements of
> the same section are grouped together and we can't put elements from
> different sections in arbitrary order, unless we want to do something
> like:
> 
>     [core]
>         section = section1
>     [repo "repo1"]
>         url = repo1.git
>         path = /path/to/repo1/
>     [core]
>         section = section2
>     [repo "repo2"]
>         url = repo2.git
>         path = /path/to/repo2/

That was what I was suggesting, except with:

    [section]
        name = section2

instead of "core.section".  I agree that it's quite ugly though.


More information about the CGit mailing list