From 260250fc1e5696334bb24c992b0d5b90302bf0ae Mon Sep 17 00:00:00 2001 From: Parzival-3141 <29632054+Parzival-3141@users.noreply.github.com> Date: Fri, 23 Oct 2026 04:37:32 -0400 Subject: [PATCH 1/2] switch to the new versioning scheme --- README.md | 9 ++++++++- build.zig.zon | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6bdbf81..5dbbbd3 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,19 @@ This is [libgit2](https://libgit2.org/) packaged using Zig's build system. While libgit2 supports many different options for system dependencies, I've opted to use [MbedTLS](https://www.trustedfirmware.org/projects/mbed-tls/) by default on Linux for TLS, crypto, and certificate support. You can replace MbedTLS with OpenSSL if you prefer. SSH support is optional, and is provided by [libssh2](https://libssh2.org/). All other dependencies are bundled in the source tree and compiled statically. +## Versioning +See `build.zig.zon` for the current Zig version, see releases for support for previous Zig/libgit2 versions. + +The versions specified in `build.zig.zon` are split between the package version (before the plus) +and the libgit2 version (after the plus). For example, version `1.0.0+1.9.0` is package version 1.0.0 +with support for libgit2 1.9.0. + ## Usage Update your `build.zig.zon`: ```sh zig fetch --save git+https://github.com/allyourcodebase/libgit2 # or if you want a tagged release -zig fetch --save https://github.com/allyourcodebase/libgit2/archive/refs/tags/${tag}.tar.gz +zig fetch --save git+https://github.com/allyourcodebase/libgit2#${tag} ``` Then, in your `build.zig`, you can access the library as a dependency: diff --git a/build.zig.zon b/build.zig.zon index 965db13..ce3ae68 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,10 +1,11 @@ .{ .name = .libgit2, - .version = "1.9.0", + .version = "1.0.0+1.9.0", .minimum_zig_version = "0.16.0", .fingerprint = 0x7f0051374dea2cba, .dependencies = .{ .libgit2 = .{ + .version = "1.9.0", .url = "https://github.com/libgit2/libgit2/archive/refs/tags/v1.9.0.tar.gz", .hash = "N-V-__8AAJbmLwHHxHDWkz0i6WIR6FpNe6tXSLzaPuWtvBBg", }, From 4cbea885fb937baaf1ab6b6937b073edbdb5b4e6 Mon Sep 17 00:00:00 2001 From: Parzival-3141 <29632054+Parzival-3141@users.noreply.github.com> Date: Fri, 23 Oct 2026 04:38:08 -0400 Subject: [PATCH 2/2] remove include guard from `build/include.h` An include guard is unecessary since this file will never be included by any C files. --- build/include.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build/include.h b/build/include.h index a7c79ad..8cd7aae 100644 --- a/build/include.h +++ b/build/include.h @@ -1,6 +1,3 @@ -#ifndef INCLUDE_git_include_h__ -#define INCLUDE_git_include_h__ - #include "git2.h" #include "git2/sys/alloc.h" #include "git2/sys/commit_graph.h" @@ -24,5 +21,3 @@ #include "git2/sys/refs.h" #include "git2/sys/remote.h" #include "git2/sys/repository.h" - -#endif // INCLUDE_git_include_h__INCLUDED