Subject: Re: [PATCH 4/5] http: centralize the accounting of libcurl dependencies

From: Junio C Hamano <[email-masked]>
Date: Thu, 09 Sep 2021 10:40:44 -0700

Jeff King <[email-masked]> writes:

>> +/**
>> + * CURLOPT_TCP_KEEPALIVE was added in 7.25.0, released in March 2012.
>> + */
>> +#ifdef CURLOPT_TCP_KEEPALIVE
>> +#define GITCURL_HAVE_CURLOPT_TCP_KEEPALIVE 1
>> +#endif
>>
>> [...]
>>
>> -#if LIBCURL_VERSION_NUM >= 0x071900
>> +#ifdef GITCURL_HAVE_CURLOPT_TCP_KEEPALIVE
>>  static void set_curl_keepalive(CURL *c)
>>  {
>>  	curl_easy_setopt(c, CURLOPT_TCP_KEEPALIVE, 1);
>
> Part of me is a little sad at the duplication this creates. We could
> just be checking
>
>   #ifdef CURLOPT_TCP_KEEPALIVE
>
> in the second hunk, without the first one at all.

I recall having exactly the same reaction when the above pattern
first was floated.  

I still do not see how the GITCURL_* duplication is worth it.  What
do we want to gain from having a "central registry"?

If it is to see which ones we care about, would it be sufficient to
use the hits from "git grep -e CURL" with postprocessing?

Thanks.