From: Derrick Stolee Date: Wed, 18 Jul 2018 16:04:05 GMT Subject: Re: [PATCH 06/16] upload-pack: generalize commit date cutoff Message-ID: <7ccf3170-dd7e-6322-a128-b31a29f6ac7b@gmail.com> In-Reply-To: On 7/16/2018 3:38 PM, Stefan Beller wrote: > On Mon, Jul 16, 2018 at 6:00 AM Derrick Stolee via GitGitGadget > wrote: >> From: Derrick Stolee >> >> The ok_to_give_up() method uses the commit date as a cutoff to avoid >> walking the entire reachble set of commits. Before moving the >> reachable() method to commit-reach.c, pull out the dependence on the >> global constant 'oldest_have' with a 'min_commit_date' parameter. > > 'oldest_have' seems to be used in only one method after that > (function got_oid); but as that function is called many times > we either have to make it a function-global or pass around as a parameter, > we'll defer that to later. There is a lot of global state involved in this negotiation code, and it lives between negotiation rounds when the transfer is stateful. Tread carefully! I did not attempt to reduce the global state at all. Thanks, -Stolee