Skip to content

Getty/p5-git-libgit2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git::Libgit2

Low-level FFI::Platypus bindings to the libgit2 C library, via Alien::Libgit2.

No fork/exec, no XS — Git operations run in-process against libgit2 through a thin FFI layer that stays intentionally close to the C surface.

Why it exists

Git::Libgit2 is the bindings layer. It exposes git_* functions and the constants needed to drive libgit2 directly. It does not try to be ergonomic — for an idiomatic Perl object wrapper with RAII handle management, use Git::Native, which is built on top of this module.

  • direct git_* FFI calls live in Git::Libgit2::FFI
  • return codes are checked with check_rc
  • errors throw Git::Libgit2::Error (carrying the libgit2 code + class)

Synopsis

use Git::Libgit2 qw( init_lib version check_rc );

init_lib();
printf "libgit2 %s\n", version();

use Git::Libgit2::FFI;
my $rc = Git::Libgit2::FFI::git_repository_open(\my $repo, '/path/to/.git');
check_rc $rc;

Installation

cpanm Git::Libgit2

Requires a working libgit2, provided automatically through Alien::Libgit2.

See also

License

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

About

Low-level FFI::Platypus bindings to libgit2, via Alien::Libgit2

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors