Thread (138 messages) 138 messages, 11 authors, 2025-01-30

Re: [PATCH v3 3/6] libgit-sys: add repo initialization and config access

From: Eric Sunshine <hidden>
Date: 2024-09-06 22:53:53

On Fri, Sep 6, 2024 at 6:21 PM Calvin Wan [off-list ref] 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 [off-list ref]
Signed-off-by: Calvin Wan <redacted>
Josh's sign-off is missing?
quoted hunk ↗ jump to hunk
---
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.)
quoted hunk ↗ jump to hunk
+
+    // 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;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help