From: Jonathan Tan Date: Fri, 25 Oct 2019 17:41:29 GMT Subject: Re: [PATCH v3] fetch: delay fetch_if_missing=0 until after config Message-ID: <20191025174129.194010-1-jonathantanmy@google.com> In-Reply-To: > > Instead, we can control whether a region of code lazy-fetches... > > The approach "from here to there, we can set global to forbid > lazy-fetch" may prolong the life support of the quick-and-dirty > mechanism, but it has to assume you can say "from here to there"; it > would mean that we cannot go multi-threaded until we get off of it. By "from here to there", I meant, for example, creating a struct repository in cmd_fetch() that has fetch_if_missing=0, then passing that repository to fetch_pack() (once fetch_pack() and all functions it calls support a repository object). In that way, from here (start of fetch_pack()) to there (end of fetch_pack()) there will be no lazy fetching. As a bonus, if we ever want to support fetching in repositories other than the_repository (e.g. submodules), this change will allow us to support that too. I don't think this is quick-and-dirty, and I don't see how this prevents multithreading.