The following steps can be used to update libgit2:
Update the submodule. There are several ways to go about this. One way is to go to the libgit2-sys/libgit2
directory and run git fetch origin
to download the latest updates, and then check out a specific tag (such as git checkout v1.4.1
).
Update all the references to the version:
libgit2-sys/build.rs
. There is a version probe (search for cfg.range_version
) which should be updated.libgit2-sys/Cargo.toml
. Update the metadata portion (the part after the +
) to match libgit2. Also bump the Cargo version (the part before the +
), keeping in mind if this will be a SemVer breaking change or not.Cargo.toml
to match the version in the last step (do not include the +
metadata). Also update the version of the git2
crate itself so it will pick up the change to libgit2-sys
(also keeping in mind if it is a SemVer breaking release).README.md
if needed. There are two places, the Cargo.toml
example and the description of the libgit2 version it binds with.html_root_url
attribute in the lib.rs
of each library.Run tests. cargo test -p git2 -p git2-curl
is a good starting point.
Run systest
. This will validate for any C-level API problems.
cargo run -p systest
The changelog at https://github.com/libgit2/libgit2/blob/main/docs/changelog.md can be helpful for seeing what has changed. The project has recently started labeling API and ABI breaking changes with labels: https://github.com/libgit2/libgit2/pulls?q=is%3Apr+label%3A%22api+breaking%22%2C%22abi+breaking%22+is%3Aclosed Alternatively, running git diff [PREV_VERSION]..[NEW_VERSION] --ignore-all-space -- include/
can provide an overview of changes made to the API.
Once you have everything functional, publish a PR with the updates.
Checklist for preparing for a release:
libgit2-sys
git2
git2-curl
git2
's dependency on libgit2-sys
git2-curl
's dependency on git2
libgit2-sys/build.rs
README.md
html_root_url
values in the source code.There is a GitHub workflow to handle publishing to crates.io and tagging the release. There are two different ways to run it:
gh workflow run publish.yml -R rust-lang/git2-rs