[PATCH 2/2] Add feature: obtain repo section from git config

Ferry Huberts mailings at hupie.com
Mon Jun 6 19:38:13 CEST 2011


On 06/06/2011 07:13 PM, larsh at hjemli.net wrote:
> On Fri, Jun 03, 2011 at 07:21:02PM -0400, Jamie Couture wrote:
>> +section-from-repo-config::
>> +	If set to "1" obtain the section name from git config. The expected config
>> +	section.key that is used is "cgit.section".
>> +	Ex: $ git config cgit.section mysection
>> +	An alternative to section-from-path, and will not check git config if
>> +	section-from-path is set. See also: scan-path.  This must be defined prior
>> +	to scan-path.
>> +
> 
> * What value is added by $GITDIR/config compared to $GITDIR/cgitrc?
> * If we want to support reading repo-config from $GITDIR/config, why not
>   implement all the options supported by a $GITDIR/cgitrc?
> 

I thought about this too.

It seems attractive but to me is mixing concerns: git and cgit are two
different tools (although closely tied). Having cgit store (part of) its
configuration in git configuration files is not good architecture,
unwise and fragile since it make the cgit configuration directly
dependent on git configuration. cgit can't change it's configuration
format since it has to follow git's and once git changes its format cgit
immediately breaks.

I'd prefer not doing this (everything in $GITDIR/config). I think it's
better to have $GITDIR/cgitrc files that hold the repo settings.

There is this setting called repo.path though that then is kind of an
annoyance to set and update. If we always use $GITDIR/cgitrc files then
the repo.path setting could be automatically deduced by cgit.


-- 
Ferry Huberts




More information about the CGit mailing list