git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-curl-compat.h: addition of all symbols defined by curl

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 15, 2022, 19:30 UTC
Message-ID
<220315.86pmmndmre.gmgdl@evledraar.gmail.com>
In-Reply-To
<20220315131638.924669-1-gitter.spiros@gmail.com>
On Tue, Mar 15 2022, Elia Pinto wrote:
Show 15 quoted lines
> This file was produced from a modified version of symbols.pl
> (https://github.com/curl/curl/blob/master/docs/libcurl/symbols.pl) and
> by manually adding the previous comments describing the dates of release
> of some curl versions not currently reported in the symbols-in-versions.
>
> To do this the symbols are listed in the order defined in the file
> symbols-in-versions rather than as they were previously inserted based
> on release dates.
>
> Most of these symbols are not used by git today. However, inserting
> them all starting from an automatic tool makes it largely unnecessary
> to update this file and therefore reduces the possibility
> of introducing possible errors in the future.
> [...]
>  1 file changed, 2875 insertions(+), 69 deletions(-)
*gulp* :)
> +#define LIBCURL_HAS(x) \
> +  (defined(x ## _FIRST) && (x ## _FIRST <= LIBCURL_VERSION_NUM) && \
> +   (!defined(x ## _LAST) || ( x ## _LAST >= LIBCURL_VERSION_NUM)))

As the recent author of this file I think there's certainly space to improve it, e.g. perhaps this macro & the change Junio suggests downthread, but...

> +#define CURLALTSVC_H1_FIRST 0x074001 /* Added in 7.64.1 */
> +#define GIT_CURL_HAVE_CURLALTSVC_H1 \
[snip ~3k lines lines]

I'd really prefer for us not to go down this route. If you look at the patches I did where I removed the version comparisons in favor of these GIT_* constants the improvement was in readability & discovery. I.e. to see at a glance where this project was on curl compatibility & compatibility shims.

If we add a new version-dependant curl feature the time saving is really not going to be in adding a trivial GIT_CURL_* line to the file. It's always going to be the compatibility shim itself that takes *much* longer.

Right now you can easily discover where we need those shims with "git grep GIT_?CURL" (the "?" needing fixing, as noted downthread), after this...

Previous: Elia Pinto
Message 4 of 4 in “git-curl-compat.h: addition of all symbols defined by curl”
  1. git-curl-compat.h: addition of all symbols defined by curlElia Pinto, Mar 15, 2022
  2. Junio C HamanoMar 15, 2022
  3. Elia PintoMar 16, 2022
  4. Ævar Arnfjörð BjarmasonMar 15, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.