Changes for version 0.007 - 2026-08-30

  • New cert_hostkey_offsets: byte offsets of git_cert_hostkey's type, hash_sha1 and hash_sha256 fields, for reading host key hashes from the certificate handed to a certificate_check callback. Derived from the ABI's int size - the struct is padding-free up to the end of hash_sha256 and, unlike git_fetch_options.prune, nothing in it moves between libgit2 releases. Lets Git::Native drop its compiled-in copies of the same three numbers (its karr #30).
  • Fix t/11-revwalk.t failing on perl >= 5.41 (GH #1, reported against every release since 0.004; reproduced on 5.42.3). The fixture helpers returned scalar_to_buffer pointers to sub-local buffers, and the "pre-allocated at outer scope" commit buffers were parameter copies, so those pointers only stayed valid through copy-on-write buffer sharing. perl commit 06e421c559 (perl5#22704, in 5.41) gives constant-folded strings the COW flag, scalar_to_buffer then un-COWs them into a fresh buffer, and the shared-buffer coincidence the test leaned on was gone: the recorded c3 hex was stale memory and the b3 walk "returned the wrong commit". t/11, t/12 and t/13 now pass OIDs between scopes as their 20-byte strings and take every pointer freshly in the scope that uses it; t/24 already did. No library change - oid_from_hex/oid_to_hex handle COW correctly, verified on 5.42.3, and the full suite passes there.
  • cpanfile: require Alien::Libgit2 0.002, which raises the libgit2 floor to 1.9.3. Below that an ssh peer that accepts the connection and then stays silent hangs the transport unboundedly (libgit2 PR #7165); the remote bindings here are how that loop is reached from Perl. Alien::Libgit2 0.002 must ship before this release.
  • cpanfile: Path::Tiny was missing from the test prereqs. 22 of the 30 test files load it and it is not core, so a smoker without it already installed failed at `make test`. Predates this release.
  • t/03-error.t: pin GIT_EUNCHANGED (-38), GIT_ENOTSUPPORTED (-39) and GIT_EREADONLY (-40). The file stopped at GIT_TIMEOUT (-37), the old end of the enum, leaving the three codes this release adds exported but unasserted.
  • git_libgit2_opts_int: a second binding of git_libgit2_opts for its (int, int) vararg shape, plus the constants it exists for, GIT_OPT_SET_SERVER_CONNECT_TIMEOUT and GIT_OPT_SET_SERVER_TIMEOUT (libgit2 1.8+, milliseconds, 0 = no limit). Without them libgit2's network reads have no bound at all: a peer that completes the TCP handshake and then stays silent blocks the calling thread forever, with no callback in between, and the one attached vararg shape -- (int, string) -- could not carry an int value. The GET_* counterparts stay unbound: their vararg is an out pointer, and FFI::Platypus 2.11 segfaults on a pointer type in a variadic argument list.
  • fetch_options_prune_offset: probe where `prune` sits inside git_fetch_options in the libgit2 this process is actually linked against, instead of leaving consumers to compile the offset in. The field follows the embedded git_remote_callbacks struct, which grew from 120 bytes in 1.5 to 128 in 1.9, so a fixed offset does not merely miss: under 1.9 it lands on `update_refs`, a function pointer that libgit2 prefers over `update_tips` and calls.
  • Complete the error-code mirror through the end of the C enum: GIT_EUNCHANGED (-38), GIT_ENOTSUPPORTED (-39), GIT_EREADONLY (-40).
  • Document git_fetch_options_init and git_push_options_init, the only two bound functions that had no POD. List fetch_options_prune_offset under EXPORTS, where it was missing since it was added.
  • Fix the SYNOPSIS: `printf "libgit2 %s\n", version()` called version() in list context, printing just the major number plus a redundant-argument warning. Now `scalar version()`.
  • Group headings in Git::Libgit2::FFI are =head1, not =head2. They used to sit at the same level as the 236 function entries, which left the generated table of contents unable to tell a group from a function.
  • CI installs Alien::Libgit2 from CPAN rather than checking out the sibling repo, so it exercises the install path users actually take. Both paths are now pinned with ALIEN_INSTALL_TYPE instead of left to whatever pkg-config happens to find, and a new linux job covers the share build (Alien's bundled libgit2 1.9.3) that a user without a system libgit2 gets. Each job reports the install type and libgit2 version it linked against.
  • README: state the situation instead of implying it. The layer stack down from App::karr is spelled out, so it is clear which questions this layer declines to answer; the runtime struct-layout hazard has its own section; TODO.md is linked as the record of what is deliberately unbound. The function list covers all 236 bindings (34 were missing, among them the whole git_object_* and git_oid_* families) and no longer claims a git_conflicts_next, which never existed.

Documentation

Modules

Low-level FFI bindings to libgit2
Wraps git_error_last() into a Perl structure
Internal FFI::Platypus instance for Git::Libgit2