gitgud_gix
Rustler NIF wrapping gitoxide.
Provides fast in-process git reads to GitGud.Git.Nif.
When this crate is not built, GitGud.Git transparently uses
GitGud.Git.Cli instead — so the rest of the app keeps working without
a Rust toolchain.
To wire it in
-
Add to
mix.exs:{:rustler, "~> 0.34"} -
In
lib/git_gud/git/nif.ex, replace the stubs with:use Rustler, otp_app: :git_gud, crate: "gitgud_gix"def nif_loaded?, do: false # overridden by the NIF on loaddef available?, do: function_exported?(__MODULE__, :nif_loaded?, 0) and nif_loaded?() -
mix compile— Rustler will build the crate.
API surface
See src/lib.rs. Currently implemented:
nif_loaded?/0init_bare/1list_refs/1blob_bytes/2blob_meta/2resolve/2
Stubbed (returns {:error, :unsupported} — Cli backend handles these):
log/3,commit/2,tree/2,diff_stats/3
Fill in incrementally.