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

Re: [PATCH v0 1/1] Teach git version --build-options about OpenSSL

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 20, 2024, 18:27 UTC
Message-ID
<xmqq8qyzv5a3.fsf@gitster.g>
In-Reply-To
<20240619172421.33548-2-randall.becker@nexbridge.ca>
"Randall S. Becker" <the.n.e.key@gmail.com> writes:
Show 22 quoted lines
> This change uses the OpenSSL supplied OPENSSL_VERSION_TEXT #define supplied
> for this purpose by that project. If the #define is not present, the version
> is not reported.
>
> Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
> ---
>  help.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/help.c b/help.c
> index 1d057aa607..ce55aaa2c0 100644
> --- a/help.c
> +++ b/help.c
> @@ -757,6 +757,9 @@ void get_version_info(struct strbuf *buf, int show_build_options)
>  
>  		if (fsmonitor_ipc__is_supported())
>  			strbuf_addstr(buf, "feature: fsmonitor--daemon\n");
> +#if defined OPENSSL_VERSION_TEXT
> +		strbuf_addf(buf, "OpenSSL: %s\n", OPENSSL_VERSION_TEXT);
> +#endif
>  	}
>  }

It is kind-a surprising that we do not need to play with any Makefile macros for this implementation.

If some unknown version (either in the long past or in the future) of OpenSSL does not define the constant, this is just compiled out and that would be OK.

If some unknown version of OpenSSL does define it but not as a string constant, it would break the build, e.g.,

	#define OPENSSL_VERSION_TEXT 2 plus 4 is 6

We could stringify it ourselves, but that is probably not worth worrying about.

Will queue.  Thanks.
Previous: Randall S. BeckerNext: Junio C Hamano
Message 3 of 10 in “Teach git version --build-options about OpenSSL”
  1. 0/1 Teach git version --build-options about OpenSSLRandall S. Becker, Jun 19, 2024
  2. 1/1 Teach git version --build-options about OpenSSLRandall S. Becker, Jun 19, 2024
  3. Junio C HamanoJun 20, 2024
  4. Junio C HamanoJun 20, 2024
  5. Randall BeckerJun 20, 2024
  6. rsbecker@nexbridge.comJun 20, 2024
  7. Junio C HamanoJun 20, 2024
  8. rsbecker@nexbridge.comJun 21, 2024
  9. Junio C HamanoJun 21, 2024
  10. Randall BeckerJun 20, 2024

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.