Skip to content

Introduce libgit-rs, a Rust wrapper around libgit.a

Calvin Wan git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest6 patches 33 repliesIn review

Changes in v3 from the cover letter

* Renamed cgit-rs to libgit-rs and cgit-sys to libgit-sys

* Makefile cleanup, particularly adding config.mak options that developers can set to run Rust builds and tests by default (Patch 6)

* Provide testdata configs for unit tests

* ConfigSet API now uses &Path instead of &str -- more ergonomic for Rust users to pass in and errors out if the path string isn't UTF-8

* Fixed unresolved dependency on libz in Cargo.toml

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6common-main: split init and exit code into new filesMakefile common-exit.c common-init.c +2 more+99 -810 replies
2/6libgit-sys: introduce Rust wrapper for libgit.a.gitignore Makefile contrib/libgit-rs/libgit-sys/Cargo.lock +6 more+197 -06 replies
3/6libgit-sys: add repo initialization and config accesscontrib/libgit-rs/libgit-sys/public_symbol_export.c contrib/libgit-rs/libgit-sys/public_symbol_export.h contrib/libgit-rs/libgit-sys/src/lib.rs+89 -27 replies
4/6config: add git_configset_alloc() and git_configset_clear_and_free()config.c config.h+21 -06 replies
5/6libgit: add higher-level libgit crate.gitignore Makefile contrib/libgit-rs/Cargo.lock +8 more+237 -28 replies
6/6Makefile: add option to build and test libgit-rs and libgit-rs-sysMakefile t/Makefile+32 -06 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by.

PatchKyle LippincottCalvin WanJosh Steadmon
1/6
2/6Co-authored-by Co-authored-by
3/6Co-authored-by
4/6Co-authored-by
5/6Co-authored-by
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/6] Introduce libgit-rs, a Rust wrapper around libgit.a

This series provides two small Rust wrapper libraries around parts of
Git: "libgit-sys", which exposes a few functions from libgit.a, and "libgit", which provides a more Rust-friendly interface to some of those functions. In addition to included unit tests, at $DAYJOB we have tested building JJ[1] with our library and used it to replace some of the libgit2-rs uses.

[1] https://github.com/martinvonz/jj

Please find V1 cover letter here:
https://lore.kernel.org/git/[email protected]/

Changes in V3:
* Renamed cgit-rs to libgit-rs and cgit-sys to libgit-sys

* Makefile cleanup, particularly adding config.mak options that developers can set to run Rust builds and tests by default (Patch 6)

* Provide testdata configs for unit tests

* ConfigSet API now uses &Path instead of &str -- more ergonomic for Rust users to pass in and errors out if the path string isn't UTF-8

* Fixed unresolved dependency on libz in Cargo.toml

Known NEEDSWORK:

* Supports older Rust versions by removing any dependencies introduced after 1.63.0 (Debian stable)

* Investigate alternative methods of managing symbol visibility.

* Figure out symbol versioning

* Automate the process of exporting additional functions in libgit-sys (possibly with a wrapper script around bindgen)

Calvin Wan (3):
libgit-sys: add repo initialization and config access
libgit: add higher-level libgit crate
Makefile: add option to build and test libgit-rs and libgit-rs-sys

Josh Steadmon (3):
common-main: split init and exit code into new files
libgit-sys: introduce Rust wrapper for libgit.a
config: add git_configset_alloc() and git_configset_clear_and_free()

 .gitignore                                    |   2 +
 Makefile                                      |  31 +++++
 common-exit.c                                 |  26 ++++
 common-init.c                                 |  63 +++++++++
 common-init.h                                 |   6 +
 common-main.c                                 |  83 +-----------
 config.c                                      |  11 ++
 config.h                                      |  10 ++
 contrib/libgit-rs/Cargo.lock                  |  62 +++++++++
 contrib/libgit-rs/Cargo.toml                  |  10 ++
 contrib/libgit-rs/libgit-sys/Cargo.lock       |  55 ++++++++
 contrib/libgit-rs/libgit-sys/Cargo.toml       |  12 ++
 contrib/libgit-rs/libgit-sys/README.md        |  15 +++
 contrib/libgit-rs/libgit-sys/build.rs         |  31 +++++
 .../libgit-sys/public_symbol_export.c         |  76 +++++++++++
 .../libgit-sys/public_symbol_export.h         |  28 ++++
 contrib/libgit-rs/libgit-sys/src/lib.rs       | 124 ++++++++++++++++++
 contrib/libgit-rs/src/lib.rs                  |  85 ++++++++++++
 contrib/libgit-rs/testdata/config1            |   2 +
 contrib/libgit-rs/testdata/config2            |   2 +
 contrib/libgit-rs/testdata/config3            |   2 +
 t/Makefile                                    |  16 +++
 22 files changed, 671 insertions(+), 81 deletions(-)
 create mode 100644 common-exit.c
 create mode 100644 common-init.c
 create mode 100644 common-init.h
 create mode 100644 contrib/libgit-rs/Cargo.lock
 create mode 100644 contrib/libgit-rs/Cargo.toml
 create mode 100644 contrib/libgit-rs/libgit-sys/Cargo.lock
 create mode 100644 contrib/libgit-rs/libgit-sys/Cargo.toml
 create mode 100644 contrib/libgit-rs/libgit-sys/README.md
 create mode 100644 contrib/libgit-rs/libgit-sys/build.rs
 create mode 100644 contrib/libgit-rs/libgit-sys/public_symbol_export.c
 create mode 100644 contrib/libgit-rs/libgit-sys/public_symbol_export.h
 create mode 100644 contrib/libgit-rs/libgit-sys/src/lib.rs
 create mode 100644 contrib/libgit-rs/src/lib.rs
 create mode 100644 contrib/libgit-rs/testdata/config1
 create mode 100644 contrib/libgit-rs/testdata/config2
 create mode 100644 contrib/libgit-rs/testdata/config3
Signature · 1 line
2.46.0.469.g59c65b2a67-goog