[RFC PATCH 2/2] cgit.c: add 'clone-url' setting with support for macro expansion

larsh at hjemli.net larsh at hjemli.net
Tue Jun 7 18:14:38 CEST 2011


On Tue, Jun 07, 2011 at 05:45:56PM +0200, Ferry Huberts wrote:
> On 06/07/2011 12:37 AM, larsh at hjemli.net wrote:
> > From: Lars Hjemli <hjemli at gmail.com>
> > * Macro expansion also eases the 'remove-suffix' pain since it's now
> >   possible to define e.g. 'clone-url=git://foo.org/$CGIT_REPO_URL.git' for
> >   a set of repos. A furter improvement would be to define e.g.
> >   $CGIT_REPO_SUFFIX to '.git' for all repos which had their url prettified,
> 
> I think this is a good idea
> 
> >   or to store the original $CGIT_REPO_URL in e.g. $CGIT_REPO_REAL_URL before
> >   suffix removal.
> 
> I prefer this less

I tend to agree.


> > +MACRO EXPANSION
> > +---------------
> > +Certain cgitrc settings supports a simple macro expansion feature, where
> > +tokens prefixed with '$' are replaced with the value of the environment
> > +variable named by the token[*]. The settings which supports this feature are
> > +divided in two groups:
> > +
> > +* Settings expanded prior to request processing. These settings are typically
> 
> better use a '-' here, a '*' could be confusing with the [*] above

Good eyes.

 
> > +used to implement virtual hosting based on environment variables set by the
> > +web-server (e.g. HTTP_HOST):
> 
> so using $HTTP_HOST will be expanded? that would be awesome!

Yes, this has been supported (but not documented) in master since
5c5d1896 (july 2010).


> Reviewed-by: Ferry Huberts <mailings at hupie.com>

Thanks.

--
larsh




More information about the CGit mailing list