From mboxrd@z Thu Jan 1 00:00:00 1970 From: john at keeping.me.uk (John Keeping) Date: Wed, 5 Jun 2013 12:15:11 +0100 Subject: [RFC] Using Git's internal config system In-Reply-To: <20130605105257.GA15273@blizzard> References: <20130605100658.GA20440@blizzard> <20130605102653.GR1072@serenity.lan> <20130605105257.GA15273@blizzard> Message-ID: <20130605110218.GA27297@serenity.lan> 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.