GitXplorerGitXplorer
r

git2-rs

public
1760 stars
399 forks
144 issues

Commits

List of commits on branch master.
Verified
81522979178da3751ba9ebe460f9e45cda706a6e

Merge pull request #1117 from ehuss/relnotes-1.9

eehuss committed 13 days ago
Unverified
7173e500bebc24fef3a8986c77fd3d26ea0b237c

Add release notes for 1.9 changes

eehuss committed 13 days ago
Verified
14cdc1573c29339ef1a00b3251d3a8bc0acaa52f

Merge pull request #1115 from ehuss/lock-locked

eehuss committed 13 days ago
Verified
cbf9dd4fd7ed1ee751aa4fff535c4bdcc5b3f6ed

Merge pull request #1116 from ehuss/update-time

eehuss committed 13 days ago
Unverified
e46a1f956e2223db21e36d40c03208bfc38d60c4

Check that Cargo.lock is not outdated in CI

eehuss committed 13 days ago
Unverified
a4bd932a19a625ee69212c77994c2290d650a7c2

Update the `time` dev-dependency

eehuss committed 13 days ago

README

The README file for this repository.

git2-rs

Documentation

libgit2 bindings for Rust.

[dependencies]
git2 = "0.20.0"

Rust version requirements

git2-rs works with stable Rust, and typically works with the most recent prior stable release as well.

Version of libgit2

Currently this library requires libgit2 1.9.0 (or newer patch versions). The source for libgit2 is included in the libgit2-sys crate so there's no need to pre-install the libgit2 library, the libgit2-sys crate will figure that and/or build that for you. On the other hand, if an appropriate version of libgit2 is present, git2 will attempt to dynamically link it.

To be more precise, the vendored libgit2 is linked statically if two conditions both hold:

  • The environment variable LIBGIT2_NO_VENDOR=1 is not set
  • and either a) The Cargo feature vendored-libgit2 is set or b) an appropriate version of libgit2 cannot be found on the system.

In particular, note that the environment variable overrides the Cargo feature.

Building git2-rs

$ git clone https://github.com/rust-lang/git2-rs
$ cd git2-rs
$ cargo build

Automating Testing

Running tests and handling all of the associated edge cases on every commit proves tedious very quickly. To automate tests and handle proper stashing and unstashing of unstaged changes and thus avoid nasty surprises, use the pre-commit hook found here and place it into the .git/hooks/ with the name pre-commit. You may need to add execution permissions with chmod +x.

To skip tests on a simple commit or doc-fixes, use git commit --no-verify.

Building on macOS 10.10+

If the ssh feature is enabled (and it is by default) then this library depends on libssh2 which depends on OpenSSL. To get OpenSSL working follow the openssl crate's instructions.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in git2-rs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.