Policy on global variables

Jason A. Donenfeld Jason at zx2c4.com
Thu Jan 16 12:31:15 CET 2014

On Thu, Jan 16, 2014 at 11:47 AM, Eric Wong <normalperson at yhbt.net> wrote:
> Lars Hjemli <hjemli at gmail.com> wrote:
>> Supporting something like FCGI in cgit will require a fork(2) for each
>> request, before invoking libgit.a functions, since these functions are
>> not generally reentrant (they tend to use global state and/or
>> inconveniently die(3)).
> Unfortunately true for now, but libgit.a could evolve (or cgit can use
> something like libgit2 instead).

Cgit is unlikely to move to libgit2 in the near future. (Unless
someone is willing to do the job and argue for why it's preferred over
mainline git, beyond its reentrancy...)

I guess, though, libgit.a is likely to never evolve to receive
reentrant functions and do away with die() (though the die calls could
easily be circumvented by hooking libc's exit...yuck), because libgit2
exists for this reason.

I am therefore tempted to follow Lars' suggestion, and merge lf/global-ctx.

More information about the CGit mailing list