diff mbox series

[1/2] help: include git-zlib.h to print zlib version

Message ID 20250307-toon-zlib-git-version-v1-1-5e8069752bb9@iotcl.com (mailing list archive)
State Accepted
Commit 49d9cd8dea520a318412792b50ab4b91ce71b9fe
Headers show
Series Ensure zlib version is printed by git-version(1) | expand

Commit Message

Toon Claes March 7, 2025, 2:18 p.m. UTC
In 41f1a8435a (git-compat-util: move include of "compat/zlib.h" into
"git-zlib.h", 2025-01-28) some code was refactored to enable easier
linking against zlib-ng.

This removed `zlib.h` being indirectly included in `help.c`. As this
file uses `ZLIB_VERSION` to print the version number of zlib when
running git-version(1) with `--build-options`, this resulted in a
regression.

Include `git-zlib.h` directly into `help.c` to print zlib version
information. This brings back the zlib version in the output of
`git version --build-options`.

Signed-off-by: Toon Claes <toon@iotcl.com>
---
 help.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Junio C Hamano March 7, 2025, 8:25 p.m. UTC | #1
Toon Claes <toon@iotcl.com> writes:

> In 41f1a8435a (git-compat-util: move include of "compat/zlib.h" into
> "git-zlib.h", 2025-01-28) some code was refactored to enable easier
> linking against zlib-ng.
>
> This removed `zlib.h` being indirectly included in `help.c`. As this
> file uses `ZLIB_VERSION` to print the version number of zlib when
> running git-version(1) with `--build-options`, this resulted in a
> regression.
>
> Include `git-zlib.h` directly into `help.c` to print zlib version
> information. This brings back the zlib version in the output of
> `git version --build-options`.
>
> Signed-off-by: Toon Claes <toon@iotcl.com>
> ---
>  help.c | 1 +
>  1 file changed, 1 insertion(+)

OK, the user was merely "#ifdef ZLIB_VERSION", so this new inclusion
would not introduce a separate unintended breakage, I would think.

Makes sense.

Will queue.


> diff --git a/help.c b/help.c
> index 8d91afe851..707cd59b79 100644
> --- a/help.c
> +++ b/help.c
> @@ -2,6 +2,7 @@
>  #define DISABLE_SIGN_COMPARE_WARNINGS
>  
>  #include "git-compat-util.h"
> +#include "git-zlib.h"
>  #include "config.h"
>  #include "builtin.h"
>  #include "exec-cmd.h"
diff mbox series

Patch

diff --git a/help.c b/help.c
index 8d91afe851..707cd59b79 100644
--- a/help.c
+++ b/help.c
@@ -2,6 +2,7 @@ 
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
+#include "git-zlib.h"
 #include "config.h"
 #include "builtin.h"
 #include "exec-cmd.h"