From 16fd6c85e4d036e789916e4d802b47a792fe496e Mon Sep 17 00:00:00 2001 From: Justin Tobler Date: Thu, 3 Apr 2025 09:05:28 -0500 Subject: help: include SHA implementation in version info When the `--build-options` flag is used with git-version(1), additional information about the built version of Git is printed. During build time, different SHA implementations may be configured, but this information is not included in the version info. Add the SHA implementations Git is built with to the version info by requiring each backend to define a SHA1_BACKEND or SHA256_BACKEND symbol as appropriate and use the value in the printed build options. Signed-off-by: Justin Tobler Signed-off-by: Junio C Hamano --- help.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'help.c') diff --git a/help.c b/help.c index c54bd9918a..991a9525db 100644 --- a/help.c +++ b/help.c @@ -9,6 +9,7 @@ #include "run-command.h" #include "levenshtein.h" #include "gettext.h" +#include "hash.h" #include "help.h" #include "command-list.h" #include "string-list.h" @@ -803,6 +804,8 @@ void get_version_info(struct strbuf *buf, int show_build_options) #elif defined ZLIB_VERSION strbuf_addf(buf, "zlib: %s\n", ZLIB_VERSION); #endif + strbuf_addf(buf, "SHA-1: %s\n", SHA1_BACKEND); + strbuf_addf(buf, "SHA-256: %s\n", SHA256_BACKEND); } } -- cgit v1.2.3