Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto
*.rkt text eol=lf
*.scrbl text eol=lf
21 changes: 21 additions & 0 deletions Makefile.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#lang racket

(require racket-makefile
package-zipper
)


(target all
(displayln "use (make clean) or (make package)")
)

(target clean
(for-each (λ (f) (displayln f) (rm-f f)) (list-files "libgit2" #px"([.]bak|~)$" #:recursive #t))
(for-each (λ (d) (displayln d) (rm-rf d)) (list-dirs "libgit2" #px"(compiled|doc)$" #:recursive #t))
(for-each (λ (f) (displayln f) (rm-f f)) (list-files "libgit2/scribblings" #px"[.](css|js|html)$"))
)

(target package
(deps clean)
(zip-package))

8 changes: 4 additions & 4 deletions libgit2/include/blame.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
([version _uint]
[flags _uint32]
[min_match_chars _uint16]
[newest_commit _git_oid-pointer]
[oldest_commit _git_oid-pointer]
[newest_commit _git_oid]
[oldest_commit _git_oid]
[min_line _size]
[max_line _size]))

(define GIT_BLAME_OPTS_VERSION 1)

(define-cstruct _git_blame_hunk
([lines_in_hunk _size]
[final_commit_id _git_oid-pointer]
[final_commit_id _git_oid]
[final_start_line_number _size]
[final_signature _git_signature-pointer]
[orig_commit_id _git_oid-pointer]
[orig_commit_id _git_oid]
[orig_path _string]
[orig_sart_line_number _size]
[orig_signature _git_signature-pointer]
Expand Down
3 changes: 1 addition & 2 deletions libgit2/include/blob.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
git_blob_free)

(define-libgit2 git_blob_owner
(_fun _git_blob -> _git_repository)
#:wrap (allocator git_repository_free))
(_fun _git_blob -> _git_repository))

(define-libgit2 git_blob_rawcontent
(_fun _git_blob -> _bytes))
Expand Down
9 changes: 6 additions & 3 deletions libgit2/include/branch.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@
; see https://github.com/libgit2/libgit2/blob/v0.25.1/include/git2/branch.h

(define-libgit2/check git_branch_upstream_name
(_fun (_git_buf/bytes-or-null) _git_repository _string -> _int))
(_fun [out : (_git_buf/bytes-or-null)] _git_repository _string -> _int
-> out))

(define-libgit2/check git_branch_upstream_remote
(_fun (_git_buf/bytes-or-null) _git_repository _string -> _int))
(_fun [out : (_git_buf/bytes-or-null)] _git_repository _string -> _int
-> out))

(define-libgit2/check git_branch_remote_name
(_fun (_git_buf/bytes-or-null) _git_repository _string -> _int))
(_fun [out : (_git_buf/bytes-or-null)] _git_repository _string -> _int
-> out))
12 changes: 6 additions & 6 deletions libgit2/include/checkout.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
[chmod_calls _size]))

(define _git_checkout_notify_cb
(_fun _git_checkout_notify_t _string _git_diff_file-pointer _git_diff_file-pointer _git_diff_file-pointer _bytes -> _int))
(_fun _git_checkout_notify_t _string _git_diff_file-pointer _git_diff_file-pointer _git_diff_file-pointer _pointer -> _int))
(define _git_checkout_progress_cb
(_fun _string _size _size _bytes -> _void))
(_fun _string _size _size _pointer -> _void))
(define _git_checkout_perfdata_cb
(_fun _git_checkout_perfdata-pointer _bytes -> _void))
(_fun _git_checkout_perfdata-pointer _pointer -> _void))

(define-cstruct _git_checkout_opts
;; FIXME: constructor will need a wrapper to
Expand All @@ -69,9 +69,9 @@
[file_open_flags _int]
[notify_flags _uint]
[notify_cb _git_checkout_notify_cb]
[notify_payload _bytes]
[notify_payload _pointer]
[progress_cb _git_checkout_progress_cb]
[progress_payload _bytes]
[progress_payload _pointer]
[paths _git_strarray]
[baseline _git_tree]
[baseline_index _git_index]
Expand All @@ -80,7 +80,7 @@
[our_label _string]
[their_label _string]
[perfdata_cb _git_checkout_perfdata_cb]
[perfdata_payload _bytes]))
[perfdata_payload _pointer]))

; Functions

Expand Down
8 changes: 4 additions & 4 deletions libgit2/include/clone.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
GIT_CLONE_LOCAL_NO_LINKS)

(define _git_remote_create_cb
(_fun (_cpointer _git_remote) _git_repository _string _string _bytes -> _int))
(_fun (_cpointer _git_remote) _git_repository _string _string _pointer -> _int))
(define _git_repository_create_cb
(_fun (_cpointer _git_repository) _string _int _bytes -> _int))
(_fun (_cpointer _git_repository) _string _int _pointer -> _int))

(define-cstruct _git_clone_opts
([version _uint]
Expand All @@ -33,9 +33,9 @@
[local _git_clone_local_t]
[checkout_branch _string]
[repository_cb _git_repository_create_cb]
[repository_cb_payload _bytes]
[repository_cb_payload _pointer]
[remote_cb _git_remote_create_cb]
[remote_cb_payload _bytes]))
[remote_cb_payload _pointer]))

(define GIT_CLONE_OPTS_VERSION 1)

Expand Down
19 changes: 14 additions & 5 deletions libgit2/include/commit.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
(_fun _git_oid-pointer _git_repository _string _git_signature-pointer _git_signature-pointer _string _string _git_tree _size (_cpointer (_cpointer _git_commit)) -> _int))

(define-libgit2/check git_commit_create_buffer
(_fun (_git_buf/bytes-or-null) _git_repository _git_signature-pointer _git_signature-pointer _string _string _git_tree _size (_cpointer (_cpointer _git_commit)) -> _int))
(_fun [out : (_git_buf/bytes-or-null)]
_git_repository _git_signature-pointer _git_signature-pointer
_string _string _git_tree _size (_cpointer (_cpointer _git_commit))
-> _int
-> out))

(define (git_commit_create_v id repo update_ref author committer encoding message tree parent_count . parents)
(define itypes (append (list _git_oid-pointer _git_repository _string _git_signature-pointer _git_signature-pointer _string _string _git_tree _size)
Expand All @@ -57,10 +61,16 @@
git_commit_free)

(define-libgit2/check git_commit_extract_signature
(_fun (_git_buf/bytes-or-null) (_git_buf/bytes-or-null) _git_repository _git_oid-pointer _string -> _int))
(_fun [signature : (_git_buf/bytes-or-null)]
[signed-data : (_git_buf/bytes-or-null)]
_git_repository _git_oid-pointer _string
-> _int
-> (values signature signed-data)))

(define-libgit2/check git_commit_header_field
(_fun (_git_buf/bytes-or-null) _git_commit _string -> _int))
(_fun [out : (_git_buf/bytes-or-null)] _git_commit _string
-> _int
-> out))

(define-libgit2 git_commit_id
(_fun _git_commit -> _git_oid-pointer))
Expand All @@ -87,8 +97,7 @@
git_commit_free)

(define-libgit2 git_commit_owner
(_fun _git_commit -> _git_repository)
#:wrap (allocator git_repository_free))
(_fun _git_commit -> _git_repository))

(define-libgit2/alloc git_commit_parent
(_fun _git_commit _git_commit _uint -> _int)
Expand Down
39 changes: 24 additions & 15 deletions libgit2/include/config.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
(only-in "types.rkt"
_git_config
_git_config_backend
_git_repository
_git_transaction)
"../private/buffer.rkt"
"../private/base.rkt")
Expand All @@ -24,13 +25,14 @@
(define-cstruct _git_config_entry
([name _string]
[value _string]
[include_depth _uint]
[level _git_config_level_t]
[free (_fun _git_config_entry-pointer -> _void)]
[payload _bytes]))
[payload _pointer]))
(define _config_entry _git_config_entry-pointer)

(define _git_config_foreach_cb
(_fun _git_config_entry-pointer _bytes -> _int))
(_fun _git_config_entry-pointer _pointer -> _int))

(define _config_iterator (_cpointer 'git_config_iterator))

Expand All @@ -48,13 +50,13 @@
; Functions

(define-libgit2/check git_config_add_backend
(_fun _git_config _git_config_backend _git_config_level_t _bool -> _int))
(_fun _git_config _git_config_backend _git_config_level_t (_or-null _git_repository) _bool -> _int))

(define-libgit2/check git_config_add_file_ondisk
(_fun _git_config _string _git_config_level_t _bool -> _int))
(_fun _git_config _string _git_config_level_t (_or-null _git_repository) _bool -> _int))

(define-libgit2/check git_config_backend_foreach_match
(_fun _git_config_backend _string _git_config_foreach_cb _bytes -> _int))
(_fun _git_config_backend _string _git_config_foreach_cb _pointer -> _int))

(define-libgit2/check git_config_delete_entry
(_fun _git_config _string -> _int))
Expand All @@ -66,22 +68,26 @@
(_fun _config_entry -> _void))

(define-libgit2/check git_config_find_global
(_fun (_git_buf/bytes-or-null) -> _int))
(_fun [out : (_git_buf/bytes-or-null)] -> _int
-> out))

(define-libgit2/check git_config_find_programdata
(_fun (_git_buf/bytes-or-null) -> _int))
(_fun [out : (_git_buf/bytes-or-null)] -> _int
-> out))

(define-libgit2/check git_config_find_system
(_fun (_git_buf/bytes-or-null) -> _int))
(_fun [out : (_git_buf/bytes-or-null)] -> _int
-> out))

(define-libgit2/check git_config_find_xdg
(_fun (_git_buf/bytes-or-null) -> _int))
(_fun [out : (_git_buf/bytes-or-null)] -> _int
-> out))

(define-libgit2/check git_config_foreach
(_fun _git_config _git_config_foreach_cb _bytes -> _int))
(_fun _git_config _git_config_foreach_cb _pointer -> _int))

(define-libgit2/check git_config_foreach_match
(_fun _git_config _string _git_config_foreach_cb _bytes -> _int))
(_fun _git_config _string _git_config_foreach_cb _pointer -> _int))

(define-libgit2/dealloc git_config_free
(_fun _git_config -> _void))
Expand All @@ -103,16 +109,18 @@
(_fun _int _git_config _string _git_cvar_map-pointer _size -> _int))

(define-libgit2/check git_config_get_multivar_foreach
(_fun _git_config _string _string _git_config_foreach_cb _bytes -> _int))
(_fun _git_config _string _string _git_config_foreach_cb _pointer -> _int))

(define-libgit2/check git_config_get_path
(_fun (_git_buf/bytes-or-null) _git_config _string -> _int))
(_fun [out : (_git_buf/bytes-or-null)] _git_config _string -> _int
-> out))

(define-libgit2/alloc git_config_get_string
(_fun _string _git_config _string -> _int))

(define-libgit2/check git_config_get_string_buf
(_fun (_git_buf/bytes-or-null) _git_config _string -> _int))
(_fun [out : (_git_buf/bytes-or-null)] _git_config _string -> _int
-> out))

(define-libgit2/check git_config_init_backend
(_fun _git_config_backend _uint -> _int))
Expand Down Expand Up @@ -172,7 +180,8 @@
(_fun _int64 _string -> _int))

(define-libgit2/check git_config_parse_path
(_fun (_git_buf/bytes-or-null) _string -> _int))
(_fun [out : (_git_buf/bytes-or-null)] _string -> _int
-> out))

(define-libgit2/check git_config_set_bool
(_fun _git_config _string _bool -> _int))
Expand Down
3 changes: 2 additions & 1 deletion libgit2/include/describe.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
git_describe_result_free)

(define-libgit2/check git_describe_format
(_fun (_git_buf/bytes-or-null) _describe_result _git_describe_format_opts-pointer/null -> _int))
(_fun [out : (_git_buf/bytes-or-null)] _describe_result _git_describe_format_opts-pointer/null -> _int
-> out))

(define-libgit2/alloc git_describe_workdir
(_fun _describe_result _git_repository _git_describe_opts-pointer/null -> _int)
Expand Down
Loading