{"thread":{"id":"11472","subject":"libgit: git_setup_directory() is not reentrant","startedAt":"2008-01-04T17:07:17Z","lastAt":"2008-01-04T20:40:41Z","messageCount":2,"participants":["Christian Thaeter","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"64443","messageId":"477E67C5.5020301@pipapo.org","threadId":"11472","inReplyTo":null,"subject":"libgit: git_setup_directory() is not reentrant","fromName":"Christian Thaeter","fromEmail":"ct@pipapo.org","sentAt":"2008-01-04T17:07:17Z","receivedAt":"2008-01-04T17:07:17Z","isPatch":false,"sender":{"key":"ct@pipapo.org","avatar":null},"body":"While working on a git-browser, I noticed that git_setup_directory() is\nnot reentrant. Once called it initializes (by calling other functions in\nturn) several static/hidden variables which can't be altered afterwards.\nThis is ugly when one wants  to iterate over different repositories\n(generating a list of available repos).\n\nHow could we fix this?\nI would propose that subsequent 'git_setup_directory()' calls will\nreinit the setup completely.\n\nAnother way would be to provide a 'git_setup_reset()' function which\nlets one cleanup all setup things before calling 'git_setup_directory()'\nagain.\n\nComments?\n\n\tChristian\n"},{"id":"64463","messageId":"7vd4shjpdi.fsf@gitster.siamese.dyndns.org","threadId":"11472","inReplyTo":"477E67C5.5020301@pipapo.org","subject":"Re: libgit: git_setup_directory() is not reentrant","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-04T20:40:41Z","receivedAt":"2008-01-04T20:40:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Thaeter <ct@pipapo.org> writes:\n\n> While working on a git-browser, I noticed that git_setup_directory() is\n> not reentrant.\n\nYup, that comes from a longstanding design of git that \"a\ncommand runs once and exits\".  Do not call that twice, or help\nthe libification effort.\n"}]}