views:

80

answers:

3

What system does git-config use to manage configuration? Is it something that's publicly available as a stand-alone library/tool? or is it tightly interwined into git?

I'd like to have something like it for my project.

Is there a library that I can use which provides similar functionality? Or should I just write my own tool/library?

+3  A: 

The code is custom. Have a look for yourself (see builtin-config.c, config.c).

See the license (GPL v2) for details on reuse.

It is not a generic library, nor is it a generic tool (though you might be able to use it as one if you alway pass --file and are OK with the way it does subsections), so it will take some work to adapt the code.

Chris Johnsen
+2  A: 

In addition to Chris Johnsen answer: there is Config::GitLike Perl module on CPAN.
It is not part of Git project

Jakub Narębski
+1  A: 

For Python, there is the ConfigParser module, which uses a similar file format.

jleedev