[PATCH v3 0/4] Hand the repo configuration to the filters

Lars Hjemli hjemli at gmail.com
Sat Mar 26 13:50:05 CET 2011


On Sat, Mar 26, 2011 at 12:45, Ferry Huberts <mailings at hupie.com> wrote:
> On 03/26/2011 11:48 AM, Lars Hjemli wrote:
>> On Wed, Mar 23, 2011 at 11:57, Ferry Huberts <mailings at hupie.com> wrote:
>>> Ferry Huberts (5):
>>>  new_filter: determine extra_args from filter type
>>>  cgit_open_filter: also take the repo as a parameter
>>>  cgit_open_filter: hand down repo configuration to script
>>>  filters: document environment variables in filter scripts
>>
>> Thanks. I've applied this to my wip branch for now with the attached
>> patch on top, since the switch from execvp() to execve() made the
>> snapshot feature stop working (make test reported "Unable to exec
>> subprocess gzip").
>>
>> --
>> larsh
>
> looks ok, but I'm a bit worried:
> Your approach would only work when parallel requests execute their own
> cgit cgi instance _and_ when setenv does not add the variables to the
> environment of the web server, but only to the environment of the
> executing cgit cgi. it thus depends heavily on the execution model,
> while my solution does not.
>
> your solution is much simpler and when we can guarantee that the
> execution model is how we expect it so that parallel requests do not
> interfere with eachother then I'm all for it.

Since the calls to setenv() are performed in the subprocess (between
fork() and execvp()), this should work even in a fastcgi-version of
cgit (the only system I know about where the environment is global is
MS-DOS, which I don't consider a likely target).

-- 
larsh




More information about the CGit mailing list