Re: [PATCH v3 3/6] libgit-sys: add repo initialization and config access
On 2024.09.06 18:53, Eric Sunshine wrote:
Show 29 quoted lines
> On Fri, Sep 6, 2024 at 6:21 PM Calvin Wan <calvinwan@google.com> wrote:
> > Wrap a few repo setup and config access functions in libgit-sys. These
> > were selected as proof-of-concept items to show that we can access local
> > config from Rust.
> >
> > Co-authored-by: Josh Steadmon <steadmon@google.com>
> > Signed-off-by: Calvin Wan <calvinwan@google.com>
>
> Josh's sign-off is missing?
>
> > ---
> > diff --git a/contrib/libgit-rs/libgit-sys/src/lib.rs b/contrib/libgit-rs/libgit-sys/src/lib.rs
> > @@ -1,8 +1,19 @@
> > extern "C" {
> > + pub fn libgit_setup_git_directory() -> *const c_char;
> > +
> > + // From config.c
> > + pub fn libgit_config_get_int(key: *const c_char, dest: *mut c_int) -> c_int;
>
> Perhaps add a comment above libgit_setup_git_directory() stating its
> origin, as you do for the other functions mentioned here?
>
> // From setup.c
> pub fn libgit_setup_git_directory() -> *const c_char;
>
> (Nit: I would probably drop the word "From" from these comments, as it
> doesn't seem to add value and ends up being noise. Even better, drop
> the comments altogether since they don't really add value and can
> easily become outdated if code is ever moved around.)Show 6 quoted lines
> > +
> > + // From common-init.c
> > + pub fn libgit_init_git(argv: *const *const c_char);
> > +
> > + // From parse.c
> > + pub fn libgit_parse_maybe_bool(val: *const c_char) -> c_int;