]> git.ipfire.org Git - thirdparty/git.git/commit
libgit: add higher-level libgit crate
authorCalvin Wan <calvinwan@google.com>
Wed, 29 Jan 2025 21:50:44 +0000 (13:50 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 Jan 2025 23:06:50 +0000 (15:06 -0800)
commit65c10aa8d5000e0ecab34a9652056f0520fe51ed
tree20cf8b5a947d7eff531b68a08af0a26691e68916
parentd76eb0dcccb19d2f85924a4be177ae76126bf5d3
libgit: add higher-level libgit crate

The C functions exported by libgit-sys do not provide an idiomatic Rust
interface. To make it easier to use these functions via Rust, add a
higher-level "libgit" crate, that wraps the lower-level configset API
with an interface that is more Rust-y.

This combination of $X and $X-sys crates is a common pattern for FFI in
Rust, as documented in "The Cargo Book" [1].

[1] https://doc.rust-lang.org/cargo/reference/build-scripts.html#-sys-packages

Co-authored-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 files changed:
.gitignore
Makefile
contrib/libgit-rs/Cargo.lock [new file with mode: 0644]
contrib/libgit-rs/Cargo.toml [new file with mode: 0644]
contrib/libgit-rs/README.md [new file with mode: 0644]
contrib/libgit-rs/build.rs [new file with mode: 0644]
contrib/libgit-rs/src/config.rs [new file with mode: 0644]
contrib/libgit-rs/src/lib.rs [new file with mode: 0644]
contrib/libgit-rs/testdata/config1 [new file with mode: 0644]
contrib/libgit-rs/testdata/config2 [new file with mode: 0644]
contrib/libgit-rs/testdata/config3 [new file with mode: 0644]
contrib/libgit-sys/src/lib.rs
t/Makefile