From mboxrd@z Thu Jan 1 00:00:00 1970 From: normalperson at yhbt.net (Eric Wong) Date: Thu, 16 Jan 2014 10:47:51 +0000 Subject: Policy on global variables In-Reply-To: References: <20140116005912.GA20306@dcvr.yhbt.net> Message-ID: <20140116104751.GA26678@dcvr.yhbt.net> Lars Hjemli wrote: > On Thu, Jan 16, 2014 at 2:00 AM, Jason A. Donenfeld wrote: > > On Thu, Jan 16, 2014 at 1:59 AM, Eric Wong wrote: > >> This. I prefer we keep passing around the ctx variable to keep the code > >> more flexible for future reuse. Of course, IIRC git itself has this > >> limitation, too... > > > > Can anyone confirm or deny this? Is it a pointless endeavor because of > > git's design? > > 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).