hlibgit2 0.5.0 → 0.6.0
raw patch · 93 files changed
+1285/−2096 lines, 93 filesdep −bytestringdep −containersdep −lens
Dependencies removed: bytestring, containers, lens, system-fileio, system-filepath, text, time
Files
- Bindings/Libgit2.hs +42/−0
- Bindings/Libgit2/Attr.hsc +18/−0
- Bindings/Libgit2/Attr.hsc.helper.c +7/−0
- Bindings/Libgit2/Blob.hsc +17/−0
- Bindings/Libgit2/Blob.hsc.helper.c +6/−0
- Bindings/Libgit2/Branch.hsc +12/−0
- Bindings/Libgit2/Commit.hsc +25/−0
- Bindings/Libgit2/Commit.hsc.helper.c +6/−0
- Bindings/Libgit2/Common.hsc +20/−0
- Bindings/Libgit2/Common.hsc.helper.c +4/−0
- Bindings/Libgit2/Config.hsc +83/−0
- Bindings/Libgit2/Diff.hsc +169/−0
- Bindings/Libgit2/Errors.hsc +66/−0
- Bindings/Libgit2/Index.hsc +70/−0
- Bindings/Libgit2/Indexer.hsc +28/−0
- Bindings/Libgit2/Merge.hsc +9/−0
- Bindings/Libgit2/Net.hsc +19/−0
- Bindings/Libgit2/Notes.hsc +22/−0
- Bindings/Libgit2/Object.hsc +18/−0
- Bindings/Libgit2/Odb.hsc +28/−0
- Bindings/Libgit2/OdbBackend.hsc +83/−0
- Bindings/Libgit2/Oid.hsc +33/−0
- Bindings/Libgit2/Reflog.hsc +19/−0
- Bindings/Libgit2/Refs.hsc +29/−0
- Bindings/Libgit2/Refspec.hsc +11/−0
- Bindings/Libgit2/Remote.hsc +32/−0
- Bindings/Libgit2/Repository.hsc +33/−0
- Bindings/Libgit2/Revwalk.hsc +22/−0
- Bindings/Libgit2/Signature.hsc +11/−0
- Bindings/Libgit2/Status.hsc +60/−0
- Bindings/Libgit2/Submodule.hsc +50/−0
- Bindings/Libgit2/Tag.hsc +26/−0
- Bindings/Libgit2/Tag.hsc.helper.c +6/−0
- Bindings/Libgit2/Threads.hsc +8/−0
- Bindings/Libgit2/Tree.hsc +42/−0
- Bindings/Libgit2/Tree.hsc.helper.c +6/−0
- Bindings/Libgit2/Types.hsc +115/−0
- Bindings/Libgit2/Version.hsc +5/−0
- Bindings/Libgit2/Windows.hsc +9/−0
- LICENSE +1/−0
- hlibgit2.cabal +7/−35
- src/Bindings/Libgit2.hs +0/−42
- src/Bindings/Libgit2/Attr.hsc +0/−18
- src/Bindings/Libgit2/Attr.hsc.helper.c +0/−7
- src/Bindings/Libgit2/Blob.hsc +0/−17
- src/Bindings/Libgit2/Blob.hsc.helper.c +0/−6
- src/Bindings/Libgit2/Branch.hsc +0/−12
- src/Bindings/Libgit2/Commit.hsc +0/−25
- src/Bindings/Libgit2/Commit.hsc.helper.c +0/−6
- src/Bindings/Libgit2/Common.hsc +0/−20
- src/Bindings/Libgit2/Common.hsc.helper.c +0/−4
- src/Bindings/Libgit2/Config.hsc +0/−83
- src/Bindings/Libgit2/Diff.hsc +0/−169
- src/Bindings/Libgit2/Errors.hsc +0/−66
- src/Bindings/Libgit2/Index.hsc +0/−70
- src/Bindings/Libgit2/Indexer.hsc +0/−28
- src/Bindings/Libgit2/Merge.hsc +0/−9
- src/Bindings/Libgit2/Net.hsc +0/−19
- src/Bindings/Libgit2/Notes.hsc +0/−22
- src/Bindings/Libgit2/Object.hsc +0/−18
- src/Bindings/Libgit2/Odb.hsc +0/−28
- src/Bindings/Libgit2/OdbBackend.hsc +0/−83
- src/Bindings/Libgit2/Oid.hsc +0/−33
- src/Bindings/Libgit2/Reflog.hsc +0/−19
- src/Bindings/Libgit2/Refs.hsc +0/−29
- src/Bindings/Libgit2/Refspec.hsc +0/−11
- src/Bindings/Libgit2/Remote.hsc +0/−32
- src/Bindings/Libgit2/Repository.hsc +0/−33
- src/Bindings/Libgit2/Revwalk.hsc +0/−22
- src/Bindings/Libgit2/Signature.hsc +0/−11
- src/Bindings/Libgit2/Status.hsc +0/−60
- src/Bindings/Libgit2/Submodule.hsc +0/−50
- src/Bindings/Libgit2/Tag.hsc +0/−26
- src/Bindings/Libgit2/Tag.hsc.helper.c +0/−6
- src/Bindings/Libgit2/Threads.hsc +0/−8
- src/Bindings/Libgit2/Tree.hsc +0/−42
- src/Bindings/Libgit2/Tree.hsc.helper.c +0/−6
- src/Bindings/Libgit2/Types.hsc +0/−115
- src/Bindings/Libgit2/Version.hsc +0/−5
- src/Bindings/Libgit2/Windows.hsc +0/−9
- src/Data/Git.hs +0/−43
- src/Data/Git/Blob.hs +0/−105
- src/Data/Git/Commit.hs +0/−31
- src/Data/Git/Common.hs +0/−34
- src/Data/Git/Errors.hs +0/−21
- src/Data/Git/Internal.hs +0/−149
- src/Data/Git/Object.hs +0/−62
- src/Data/Git/Oid.hs +0/−84
- src/Data/Git/Repository.hs +0/−21
- src/Data/Git/Stringable.hs +0/−87
- src/Data/Git/Tag.hs +0/−25
- src/Data/Git/Tree.hs +0/−84
- tests/Main.hs +8/−46
+ Bindings/Libgit2.hs view
@@ -0,0 +1,42 @@++module Bindings.Libgit2 (+ module Bindings.Libgit2.Repository,+ module Bindings.Libgit2.Config,+ module Bindings.Libgit2.Types,+ module Bindings.Libgit2.Revwalk,+ module Bindings.Libgit2.OdbBackend,+ module Bindings.Libgit2.Tag,+ module Bindings.Libgit2.Net,+ module Bindings.Libgit2.Refs,+ module Bindings.Libgit2.Refspec,+ module Bindings.Libgit2.Reflog,+ module Bindings.Libgit2.Commit,+ module Bindings.Libgit2.Index,+ module Bindings.Libgit2.Signature,+ module Bindings.Libgit2.Blob,+ module Bindings.Libgit2.Errors,+ module Bindings.Libgit2.Oid,+ module Bindings.Libgit2.Tree,+ module Bindings.Libgit2.Odb,+ module Bindings.Libgit2.Common,+ module Bindings.Libgit2.Object) where+import Bindings.Libgit2.Repository+import Bindings.Libgit2.Config+import Bindings.Libgit2.Types+import Bindings.Libgit2.Revwalk+import Bindings.Libgit2.OdbBackend+import Bindings.Libgit2.Tag+import Bindings.Libgit2.Net+import Bindings.Libgit2.Refs+import Bindings.Libgit2.Refspec+import Bindings.Libgit2.Reflog+import Bindings.Libgit2.Commit+import Bindings.Libgit2.Index+import Bindings.Libgit2.Signature+import Bindings.Libgit2.Blob+import Bindings.Libgit2.Errors+import Bindings.Libgit2.Oid+import Bindings.Libgit2.Tree+import Bindings.Libgit2.Odb+import Bindings.Libgit2.Common+import Bindings.Libgit2.Object
+ Bindings/Libgit2/Attr.hsc view
@@ -0,0 +1,18 @@+#include <bindings.dsl.h>+#include <git2.h>+#include <git2/attr.h>+module Bindings.Libgit2.Attr where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types++{- extern __attribute__((visibility("default"))) const char * git_attr__true; -}+{- extern __attribute__((visibility("default"))) const char * git_attr__false; -}+{- extern __attribute__((visibility("default"))) const char * git_attr__unset; -}++#ccall git_attr_get , Ptr (CString) -> Ptr <git_repository> -> CUInt -> CString -> CString -> IO (CInt)+#ccall git_attr_get_many , Ptr (CString) -> Ptr <git_repository> -> CUInt -> CString -> CSize -> Ptr (CString) -> IO (CInt)+#ccall git_attr_foreach , Ptr <git_repository> -> CUInt -> CString -> FunPtr (CString -> CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)+#ccall git_attr_cache_flush , Ptr <git_repository> -> IO ()+#ccall git_attr_add_macro , Ptr <git_repository> -> CString -> CString -> IO (CInt)
+ Bindings/Libgit2/Attr.hsc.helper.c view
@@ -0,0 +1,7 @@+#include <bindings.cmacros.h>+#include <git2/attr.h>++BC_INLINE1(GIT_ATTR_TRUE, const char *, int)+BC_INLINE1(GIT_ATTR_FALSE, const char *, int)+BC_INLINE1(GIT_ATTR_UNSPECIFIED, const char *, int)+BC_INLINE1(GIT_ATTR_HAS_VALUE, const char *, int)
+ Bindings/Libgit2/Blob.hsc view
@@ -0,0 +1,17 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Blob where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+import Bindings.Libgit2.Object+#cinline git_blob_lookup , Ptr (Ptr <git_blob>) -> Ptr <git_repository> -> Ptr <git_oid> -> IO (CInt)+#cinline git_blob_lookup_prefix , Ptr (Ptr <git_blob>) -> Ptr <git_repository> -> Ptr <git_oid> -> CUInt -> IO (CInt)+#cinline git_blob_free , Ptr <git_blob> -> IO ()+#ccall git_blob_rawcontent , Ptr <git_blob> -> IO (Ptr ())+#ccall git_blob_rawsize , Ptr <git_blob> -> IO (CSize)+#ccall git_blob_create_fromfile , Ptr <git_oid> -> Ptr <git_repository> -> CString -> IO (CInt)+#ccall git_blob_create_fromdisk , Ptr <git_oid> -> Ptr <git_repository> -> CString -> IO (CInt)+#ccall git_blob_create_frombuffer , Ptr <git_oid> -> Ptr <git_repository> -> Ptr () -> CSize -> IO (CInt)
+ Bindings/Libgit2/Blob.hsc.helper.c view
@@ -0,0 +1,6 @@+#include <bindings.cmacros.h>+#include <git2.h>++BC_INLINE3(git_blob_lookup, git_blob * *, git_repository *, const git_oid *, int)+BC_INLINE4(git_blob_lookup_prefix, git_blob * *, git_repository *, const git_oid *, unsigned int, int)+BC_INLINE1VOID(git_blob_free, git_blob *)
+ Bindings/Libgit2/Branch.hsc view
@@ -0,0 +1,12 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Branch where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Oid+import Bindings.Libgit2.Types+#ccall git_branch_create , Ptr <git_oid> -> Ptr <git_repository> -> CString -> Ptr <git_object> -> CInt -> IO (CInt)+#ccall git_branch_delete , Ptr <git_repository> -> CString -> <git_branch_t> -> IO (CInt)+#ccall git_branch_list , Ptr <git_strarray> -> Ptr <git_repository> -> CUInt -> IO (CInt)+#ccall git_branch_move , Ptr <git_repository> -> CString -> CString -> CInt -> IO (CInt)
+ Bindings/Libgit2/Commit.hsc view
@@ -0,0 +1,25 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Commit where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+import Bindings.Libgit2.Object+#cinline git_commit_lookup , Ptr (Ptr <git_commit>) -> Ptr <git_repository> -> Ptr <git_oid> -> IO (CInt)+#cinline git_commit_lookup_prefix , Ptr (Ptr <git_commit>) -> Ptr <git_repository> -> Ptr <git_oid> -> CUInt -> IO (CInt)+#cinline git_commit_free , Ptr <git_commit> -> IO ()+#ccall git_commit_id , Ptr <git_commit> -> IO (Ptr <git_oid>)+#ccall git_commit_message_encoding , Ptr <git_commit> -> IO (CString)+#ccall git_commit_message , Ptr <git_commit> -> IO (CString)+#ccall git_commit_time , Ptr <git_commit> -> IO (CLong)+#ccall git_commit_time_offset , Ptr <git_commit> -> IO (CInt)+#ccall git_commit_committer , Ptr <git_commit> -> IO (Ptr <git_signature>)+#ccall git_commit_author , Ptr <git_commit> -> IO (Ptr <git_signature>)+#ccall git_commit_tree , Ptr (Ptr <git_tree>) -> Ptr <git_commit> -> IO (CInt)+#ccall git_commit_tree_oid , Ptr <git_commit> -> IO (Ptr <git_oid>)+#ccall git_commit_parentcount , Ptr <git_commit> -> IO (CUInt)+#ccall git_commit_parent , Ptr (Ptr <git_commit>) -> Ptr <git_commit> -> CUInt -> IO (CInt)+#ccall git_commit_parent_oid , Ptr <git_commit> -> CUInt -> IO (Ptr <git_oid>)+#ccall git_commit_create , Ptr <git_oid> -> Ptr <git_repository> -> CString -> Ptr <git_signature> -> Ptr <git_signature> -> CString -> CString -> Ptr <git_tree> -> CInt -> Ptr (Ptr <git_commit>) -> IO (CInt)
+ Bindings/Libgit2/Commit.hsc.helper.c view
@@ -0,0 +1,6 @@+#include <bindings.cmacros.h>+#include <git2.h>++BC_INLINE3(git_commit_lookup, git_commit * *, git_repository *, const git_oid *, int)+BC_INLINE4(git_commit_lookup_prefix, git_commit * *, git_repository *, const git_oid *, unsigned, int)+BC_INLINE1VOID(git_commit_free, git_commit *)
+ Bindings/Libgit2/Common.hsc view
@@ -0,0 +1,20 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Common where+#strict_import++{- typedef struct {+ char * * strings; size_t count;+ } git_strarray; -}+#starttype git_strarray+#field strings , Ptr (CString)+#field count , CSize+#stoptype+#ccall git_strarray_free , Ptr <git_strarray> -> IO ()+#ccall git_strarray_copy , Ptr <git_strarray> -> Ptr <git_strarray> -> IO (CInt)+#ccall git_libgit2_version , Ptr CInt -> Ptr CInt -> Ptr CInt -> IO ()++{- BEGIN MANUAL ENTRY -}+#cinline GIT_PATH_LIST_SEPARATOR , CChar+#num GIT_PATH_MAX+{- END MANUAL ENTRY -}
+ Bindings/Libgit2/Common.hsc.helper.c view
@@ -0,0 +1,4 @@+#include <bindings.cmacros.h>+#include <git2.h>++BC_INLINE_(GIT_PATH_LIST_SEPARATOR, char)
+ Bindings/Libgit2/Config.hsc view
@@ -0,0 +1,83 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Config where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+{- struct git_config_file {+ struct git_config * cfg;+ int (* open)(struct git_config_file *);+ int (* get)(struct git_config_file *,+ const char * key,+ const char * * value);+ int (* get_multivar)(struct git_config_file *,+ const char * key,+ const char * regexp,+ int (* fn)(const char *, void *),+ void * data);+ int (* set)(struct git_config_file *,+ const char * key,+ const char * value);+ int (* set_multivar)(git_config_file * cfg,+ const char * name,+ const char * regexp,+ const char * value);+ int (* del)(struct git_config_file *, const char * key);+ int (* foreach)(struct git_config_file *,+ int (* fn)(const char *, const char *, void *),+ void * data);+ void (* free)(struct git_config_file *);+}; -}+#starttype git_config_file+#field cfg , Ptr <git_config>+#field open , FunPtr (Ptr <git_config_file> -> CInt)+#field get , FunPtr (Ptr <git_config_file> -> CString -> Ptr (CString) -> CInt)+#field get_multivar , FunPtr (Ptr <git_config_file> -> CString -> CString -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> CInt)+#field set , FunPtr (Ptr <git_config_file> -> CString -> CString -> CInt)+#field set_multivar , FunPtr (Ptr <git_config_file> -> CString -> CString -> CString -> CInt)+#field del , FunPtr (Ptr <git_config_file> -> CString -> CInt)+#field foreach , FunPtr (Ptr <git_config_file> -> FunPtr (CString -> CString -> Ptr () -> CInt) -> Ptr () -> CInt)+#field free , FunPtr (Ptr <git_config_file>)+#stoptype+{- typedef enum {+ GIT_CVAR_FALSE = 0,+ GIT_CVAR_TRUE = 1,+ GIT_CVAR_INT32,+ GIT_CVAR_STRING+ } git_cvar_t; -}+#integral_t git_cvar_t+#num GIT_CVAR_FALSE+#num GIT_CVAR_TRUE+#num GIT_CVAR_INT32+#num GIT_CVAR_STRING+{- typedef struct {+ git_cvar_t cvar_type; const char * str_match; int map_value;+ } git_cvar_map; -}+#starttype git_cvar_map+#field cvar_type , <git_cvar_t>+#field str_match , CString+#field map_value , CInt+#stoptype+#ccall git_config_find_global , CString -> CSize -> IO (CInt)+#ccall git_config_find_system , CString -> CSize -> IO (CInt)+#ccall git_config_open_global , Ptr (Ptr <git_config>) -> IO (CInt)+#ccall git_config_file__ondisk , Ptr (Ptr <git_config_file>) -> CString -> IO (CInt)+#ccall git_config_new , Ptr (Ptr <git_config>) -> IO (CInt)+#ccall git_config_add_file , Ptr <git_config> -> Ptr <git_config_file> -> CInt -> IO (CInt)+#ccall git_config_add_file_ondisk , Ptr <git_config> -> CString -> CInt -> IO (CInt)+#ccall git_config_open_ondisk , Ptr (Ptr <git_config>) -> CString -> IO (CInt)+#ccall git_config_free , Ptr <git_config> -> IO ()+#ccall git_config_get_int32 , Ptr CInt -> Ptr <git_config> -> CString -> IO (CInt)+#ccall git_config_get_int64 , Ptr CLong -> Ptr <git_config> -> CString -> IO (CInt)+#ccall git_config_get_bool , Ptr CInt -> Ptr <git_config> -> CString -> IO (CInt)+#ccall git_config_get_string , Ptr (CString) -> Ptr <git_config> -> CString -> IO (CInt)+#ccall git_config_get_multivar , Ptr <git_config> -> CString -> CString -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)+#ccall git_config_set_int32 , Ptr <git_config> -> CString -> CInt -> IO (CInt)+#ccall git_config_set_int64 , Ptr <git_config> -> CString -> CLong -> IO (CInt)+#ccall git_config_set_bool , Ptr <git_config> -> CString -> CInt -> IO (CInt)+#ccall git_config_set_string , Ptr <git_config> -> CString -> CString -> IO (CInt)+#ccall git_config_set_multivar , Ptr <git_config> -> CString -> CString -> CString -> IO (CInt)+#ccall git_config_delete , Ptr <git_config> -> CString -> IO (CInt)+#ccall git_config_foreach , Ptr <git_config> -> FunPtr (CString -> CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)+#ccall git_config_get_mapped , Ptr CInt -> Ptr <git_config> -> CString -> Ptr <git_cvar_map> -> CSize -> IO (CInt)
+ Bindings/Libgit2/Diff.hsc view
@@ -0,0 +1,169 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Diff where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+import Bindings.Libgit2.Tree+import Bindings.Libgit2.Refs+{- enum {+ GIT_DIFF_NORMAL = 0,+ GIT_DIFF_REVERSE = 1 << 0,+ GIT_DIFF_FORCE_TEXT = 1 << 1,+ GIT_DIFF_IGNORE_WHITESPACE = 1 << 2,+ GIT_DIFF_IGNORE_WHITESPACE_CHANGE = 1 << 3,+ GIT_DIFF_IGNORE_WHITESPACE_EOL = 1 << 4,+ GIT_DIFF_IGNORE_SUBMODULES = 1 << 5,+ GIT_DIFF_PATIENCE = 1 << 6,+ GIT_DIFF_INCLUDE_IGNORED = 1 << 7,+ GIT_DIFF_INCLUDE_UNTRACKED = 1 << 8,+ GIT_DIFF_INCLUDE_UNMODIFIED = 1 << 9,+ GIT_DIFF_RECURSE_UNTRACKED_DIRS = 1 << 10+}; -}+#num GIT_DIFF_NORMAL+#num GIT_DIFF_REVERSE+#num GIT_DIFF_FORCE_TEXT+#num GIT_DIFF_IGNORE_WHITESPACE+#num GIT_DIFF_IGNORE_WHITESPACE_CHANGE+#num GIT_DIFF_IGNORE_WHITESPACE_EOL+#num GIT_DIFF_IGNORE_SUBMODULES+#num GIT_DIFF_PATIENCE+#num GIT_DIFF_INCLUDE_IGNORED+#num GIT_DIFF_INCLUDE_UNTRACKED+#num GIT_DIFF_INCLUDE_UNMODIFIED+#num GIT_DIFF_RECURSE_UNTRACKED_DIRS+{- typedef struct {+ uint32_t flags;+ uint16_t context_lines;+ uint16_t interhunk_lines;+ char * old_prefix;+ char * new_prefix;+ git_strarray pathspec;+ } git_diff_options; -}+#starttype git_diff_options+#field flags , CUInt+#field context_lines , CUShort+#field interhunk_lines , CUShort+#field old_prefix , CString+#field new_prefix , CString+#field pathspec , <git_strarray>+#stoptype+{- typedef struct git_diff_list git_diff_list; -}+#opaque_t git_diff_list+{- enum {+ GIT_DIFF_FILE_VALID_OID = 1 << 0,+ GIT_DIFF_FILE_FREE_PATH = 1 << 1,+ GIT_DIFF_FILE_BINARY = 1 << 2,+ GIT_DIFF_FILE_NOT_BINARY = 1 << 3,+ GIT_DIFF_FILE_FREE_DATA = 1 << 4,+ GIT_DIFF_FILE_UNMAP_DATA = 1 << 5+}; -}+#num GIT_DIFF_FILE_VALID_OID+#num GIT_DIFF_FILE_FREE_PATH+#num GIT_DIFF_FILE_BINARY+#num GIT_DIFF_FILE_NOT_BINARY+#num GIT_DIFF_FILE_FREE_DATA+#num GIT_DIFF_FILE_UNMAP_DATA+{- typedef enum {+ GIT_DELTA_UNMODIFIED = 0,+ GIT_DELTA_ADDED = 1,+ GIT_DELTA_DELETED = 2,+ GIT_DELTA_MODIFIED = 3,+ GIT_DELTA_RENAMED = 4,+ GIT_DELTA_COPIED = 5,+ GIT_DELTA_IGNORED = 6,+ GIT_DELTA_UNTRACKED = 7+ } git_delta_t; -}+#integral_t git_delta_t+#num GIT_DELTA_UNMODIFIED+#num GIT_DELTA_ADDED+#num GIT_DELTA_DELETED+#num GIT_DELTA_MODIFIED+#num GIT_DELTA_RENAMED+#num GIT_DELTA_COPIED+#num GIT_DELTA_IGNORED+#num GIT_DELTA_UNTRACKED+{- typedef struct {+ git_oid oid;+ char * path;+ uint16_t mode;+ git_off_t size;+ unsigned int flags;+ } git_diff_file; -}+#starttype git_diff_file+#field oid , <git_oid>+#field path , CString+#field mode , CUShort+#field size , CLong+#field flags , CUInt+#stoptype+{- typedef struct {+ git_diff_file old_file;+ git_diff_file new_file;+ git_delta_t status;+ unsigned int similarity;+ int binary;+ } git_diff_delta; -}+#starttype git_diff_delta+#field old_file , <git_diff_file>+#field new_file , <git_diff_file>+#field status , <git_delta_t>+#field similarity , CUInt+#field binary , CInt+#stoptype+{- typedef int (* git_diff_file_fn)(void * cb_data,+ git_diff_delta * delta,+ float progress); -}+#synonym_t git_diff_file_fn , CInt+{- typedef struct {+ int old_start; int old_lines; int new_start; int new_lines;+ } git_diff_range; -}+#starttype git_diff_range+#field old_start , CInt+#field old_lines , CInt+#field new_start , CInt+#field new_lines , CInt+#stoptype+{- typedef int (* git_diff_hunk_fn)(void * cb_data,+ git_diff_delta * delta,+ git_diff_range * range,+ const char * header,+ size_t header_len); -}+#synonym_t git_diff_hunk_fn , CInt+{- enum {+ GIT_DIFF_LINE_CONTEXT = ' ',+ GIT_DIFF_LINE_ADDITION = '+',+ GIT_DIFF_LINE_DELETION = '-',+ GIT_DIFF_LINE_ADD_EOFNL = '\n',+ GIT_DIFF_LINE_DEL_EOFNL = '\0',+ GIT_DIFF_LINE_FILE_HDR = 'F',+ GIT_DIFF_LINE_HUNK_HDR = 'H',+ GIT_DIFF_LINE_BINARY = 'B'+}; -}+#num GIT_DIFF_LINE_CONTEXT+#num GIT_DIFF_LINE_ADDITION+#num GIT_DIFF_LINE_DELETION+#num GIT_DIFF_LINE_ADD_EOFNL+#num GIT_DIFF_LINE_DEL_EOFNL+#num GIT_DIFF_LINE_FILE_HDR+#num GIT_DIFF_LINE_HUNK_HDR+#num GIT_DIFF_LINE_BINARY+{- typedef int (* git_diff_data_fn)(void * cb_data,+ git_diff_delta * delta,+ git_diff_range * range,+ char line_origin,+ const char * content,+ size_t content_len); -}+#synonym_t git_diff_data_fn , CInt+#ccall git_diff_list_free , Ptr <git_diff_list> -> IO ()+#ccall git_diff_tree_to_tree , Ptr <git_repository> -> Ptr <git_diff_options> -> Ptr <git_tree> -> Ptr <git_tree> -> Ptr (Ptr <git_diff_list>) -> IO (CInt)+#ccall git_diff_index_to_tree , Ptr <git_repository> -> Ptr <git_diff_options> -> Ptr <git_tree> -> Ptr (Ptr <git_diff_list>) -> IO (CInt)+#ccall git_diff_workdir_to_index , Ptr <git_repository> -> Ptr <git_diff_options> -> Ptr (Ptr <git_diff_list>) -> IO (CInt)+#ccall git_diff_workdir_to_tree , Ptr <git_repository> -> Ptr <git_diff_options> -> Ptr <git_tree> -> Ptr (Ptr <git_diff_list>) -> IO (CInt)+#ccall git_diff_merge , Ptr <git_diff_list> -> Ptr <git_diff_list> -> IO (CInt)+#ccall git_diff_foreach , Ptr <git_diff_list> -> Ptr () -> CInt -> CInt -> CInt -> IO (CInt)+#ccall git_diff_print_compact , Ptr <git_diff_list> -> Ptr () -> CInt -> IO (CInt)+#ccall git_diff_print_patch , Ptr <git_diff_list> -> Ptr () -> CInt -> IO (CInt)+#ccall git_diff_blobs , Ptr <git_blob> -> Ptr <git_blob> -> Ptr <git_diff_options> -> Ptr () -> CInt -> CInt -> CInt -> IO (CInt)
+ Bindings/Libgit2/Errors.hsc view
@@ -0,0 +1,66 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Errors where+#strict_import++import Bindings.Libgit2.Common+{- enum {+ GIT_OK = 0,+ GIT_ERROR = -1,+ GIT_ENOTFOUND = -3,+ GIT_EEXISTS = -4,+ GIT_EAMBIGUOUS = -5,+ GIT_EBUFS = -6,+ GIT_PASSTHROUGH = -30,+ GIT_REVWALKOVER = -31+}; -}+#num GIT_OK+#num GIT_ERROR+#num GIT_ENOTFOUND+#num GIT_EEXISTS+#num GIT_EAMBIGUOUS+#num GIT_EBUFS+#num GIT_PASSTHROUGH+#num GIT_REVWALKOVER+{- typedef struct {+ char * message; int klass;+ } git_error; -}+#starttype git_error+#field message , CString+#field klass , CInt+#stoptype+{- typedef enum {+ GITERR_NOMEMORY,+ GITERR_OS,+ GITERR_INVALID,+ GITERR_REFERENCE,+ GITERR_ZLIB,+ GITERR_REPOSITORY,+ GITERR_CONFIG,+ GITERR_REGEX,+ GITERR_ODB,+ GITERR_INDEX,+ GITERR_OBJECT,+ GITERR_NET,+ GITERR_TAG,+ GITERR_TREE,+ GITERR_INDEXER+ } git_error_t; -}+#integral_t git_error_t+#num GITERR_NOMEMORY+#num GITERR_OS+#num GITERR_INVALID+#num GITERR_REFERENCE+#num GITERR_ZLIB+#num GITERR_REPOSITORY+#num GITERR_CONFIG+#num GITERR_REGEX+#num GITERR_ODB+#num GITERR_INDEX+#num GITERR_OBJECT+#num GITERR_NET+#num GITERR_TAG+#num GITERR_TREE+#num GITERR_INDEXER+#ccall giterr_last , IO (Ptr <git_error>)+#ccall giterr_clear , IO ()
+ Bindings/Libgit2/Index.hsc view
@@ -0,0 +1,70 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Index where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+{- typedef struct {+ git_time_t seconds; unsigned int nanoseconds;+ } git_index_time; -}+#starttype git_index_time+#field seconds , CLong+#field nanoseconds , CUInt+#stoptype+{- typedef struct git_index_entry {+ git_index_time ctime;+ git_index_time mtime;+ unsigned int dev;+ unsigned int ino;+ unsigned int mode;+ unsigned int uid;+ unsigned int gid;+ git_off_t file_size;+ git_oid oid;+ unsigned short flags;+ unsigned short flags_extended;+ char * path;+ } git_index_entry; -}+#starttype git_index_entry+#field ctime , <git_index_time>+#field mtime , <git_index_time>+#field dev , CUInt+#field ino , CUInt+#field mode , CUInt+#field uid , CUInt+#field gid , CUInt+#field file_size , CLong+#field oid , <git_oid>+#field flags , CUShort+#field flags_extended , CUShort+#field path , CString+#stoptype+{- typedef struct git_index_entry_unmerged {+ unsigned int mode[3]; git_oid oid[3]; char * path;+ } git_index_entry_unmerged; -}+#starttype git_index_entry_unmerged+#array_field mode , CUInt+#array_field oid , <git_oid>+#field path , CString+#stoptype+#ccall git_index_open , Ptr (Ptr <git_index>) -> CString -> IO (CInt)+#ccall git_index_clear , Ptr <git_index> -> IO ()+#ccall git_index_free , Ptr <git_index> -> IO ()+#ccall git_index_read , Ptr <git_index> -> IO (CInt)+#ccall git_index_write , Ptr <git_index> -> IO (CInt)+#ccall git_index_find , Ptr <git_index> -> CString -> IO (CInt)+#ccall git_index_uniq , Ptr <git_index> -> IO ()+#ccall git_index_add , Ptr <git_index> -> CString -> CInt -> IO (CInt)+#ccall git_index_add2 , Ptr <git_index> -> Ptr <git_index_entry> -> IO (CInt)+#ccall git_index_append , Ptr <git_index> -> CString -> CInt -> IO (CInt)+#ccall git_index_append2 , Ptr <git_index> -> Ptr <git_index_entry> -> IO (CInt)+#ccall git_index_remove , Ptr <git_index> -> CInt -> IO (CInt)+#ccall git_index_get , Ptr <git_index> -> CUInt -> IO (Ptr <git_index_entry>)+#ccall git_index_entrycount , Ptr <git_index> -> IO (CUInt)+#ccall git_index_entrycount_unmerged , Ptr <git_index> -> IO (CUInt)+#ccall git_index_get_unmerged_bypath , Ptr <git_index> -> CString -> IO (Ptr <git_index_entry_unmerged>)+#ccall git_index_get_unmerged_byindex , Ptr <git_index> -> CUInt -> IO (Ptr <git_index_entry_unmerged>)+#ccall git_index_entry_stage , Ptr <git_index_entry> -> IO (CInt)+#ccall git_index_read_tree , Ptr <git_index> -> Ptr <git_tree> -> IO (CInt)
+ Bindings/Libgit2/Indexer.hsc view
@@ -0,0 +1,28 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Indexer where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Oid+{- typedef struct git_indexer_stats {+ unsigned int total; unsigned int processed;+ } git_indexer_stats; -}+#starttype git_indexer_stats+#field total , CUInt+#field processed , CUInt+#stoptype+{- typedef struct git_indexer git_indexer; -}+#opaque_t git_indexer+{- typedef struct git_indexer_stream git_indexer_stream; -}+#opaque_t git_indexer_stream+#ccall git_indexer_stream_new , Ptr (Ptr <git_indexer_stream>) -> CString -> IO (CInt)+#ccall git_indexer_stream_add , Ptr <git_indexer_stream> -> Ptr () -> CSize -> Ptr <git_indexer_stats> -> IO (CInt)+#ccall git_indexer_stream_finalize , Ptr <git_indexer_stream> -> Ptr <git_indexer_stats> -> IO (CInt)+#ccall git_indexer_stream_hash , Ptr <git_indexer_stream> -> IO (Ptr <git_oid>)+#ccall git_indexer_stream_free , Ptr <git_indexer_stream> -> IO ()+#ccall git_indexer_new , Ptr (Ptr <git_indexer>) -> CString -> IO (CInt)+#ccall git_indexer_run , Ptr <git_indexer> -> Ptr <git_indexer_stats> -> IO (CInt)+#ccall git_indexer_write , Ptr <git_indexer> -> IO (CInt)+#ccall git_indexer_hash , Ptr <git_indexer> -> IO (Ptr <git_oid>)+#ccall git_indexer_free , Ptr <git_indexer> -> IO ()
+ Bindings/Libgit2/Merge.hsc view
@@ -0,0 +1,9 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Merge where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+#ccall git_merge_base , Ptr <git_oid> -> Ptr <git_repository> -> Ptr <git_oid> -> Ptr <git_oid> -> IO (CInt)
+ Bindings/Libgit2/Net.hsc view
@@ -0,0 +1,19 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Net where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Oid+import Bindings.Libgit2.Types+{- struct git_remote_head {+ int local : 1; git_oid oid; git_oid loid; char * name;+}; -}+#starttype git_remote_head+-- #field local , CInt+#field oid , <git_oid>+#field loid , <git_oid>+#field name , CString+#stoptype+{- typedef int (* git_headlist_cb)(git_remote_head *, void *); -}+#synonym_t git_headlist_cb , CInt
+ Bindings/Libgit2/Notes.hsc view
@@ -0,0 +1,22 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Notes where+#strict_import++import Bindings.Libgit2.Oid+import Bindings.Libgit2.Types+#ccall git_note_read , Ptr (Ptr <git_note>) -> Ptr <git_repository> -> CString -> Ptr <git_oid> -> IO (CInt)+#ccall git_note_message , Ptr <git_note> -> IO (CString)+#ccall git_note_oid , Ptr <git_note> -> IO (Ptr <git_oid>)+#ccall git_note_create , Ptr <git_oid> -> Ptr <git_repository> -> Ptr <git_signature> -> Ptr <git_signature> -> CString -> Ptr <git_oid> -> CString -> IO (CInt)+#ccall git_note_remove , Ptr <git_repository> -> CString -> Ptr <git_signature> -> Ptr <git_signature> -> Ptr <git_oid> -> IO (CInt)+#ccall git_note_free , Ptr <git_note> -> IO ()+#ccall git_note_default_ref , Ptr (CString) -> Ptr <git_repository> -> IO (CInt)+{- typedef struct {+ git_oid blob_oid; git_oid annotated_object_oid;+ } git_note_data; -}+#starttype git_note_data+#field blob_oid , <git_oid>+#field annotated_object_oid , <git_oid>+#stoptype+#ccall git_note_foreach , Ptr <git_repository> -> CString -> FunPtr (Ptr <git_note_data> -> Ptr () -> CInt) -> Ptr () -> IO (CInt)
+ Bindings/Libgit2/Object.hsc view
@@ -0,0 +1,18 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Object where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+#ccall git_object_lookup , Ptr (Ptr <git_object>) -> Ptr <git_repository> -> Ptr <git_oid> -> <git_otype> -> IO (CInt)+#ccall git_object_lookup_prefix , Ptr (Ptr <git_object>) -> Ptr <git_repository> -> Ptr <git_oid> -> CUInt -> <git_otype> -> IO (CInt)+#ccall git_object_id , Ptr <git_object> -> IO (Ptr <git_oid>)+#ccall git_object_type , Ptr <git_object> -> IO (<git_otype>)+#ccall git_object_owner , Ptr <git_object> -> IO (Ptr <git_repository>)+#ccall git_object_free , Ptr <git_object> -> IO ()+#ccall git_object_type2string , <git_otype> -> IO (CString)+#ccall git_object_string2type , CString -> IO (<git_otype>)+#ccall git_object_typeisloose , <git_otype> -> IO (CInt)+#ccall git_object__size , <git_otype> -> IO (CSize)
+ Bindings/Libgit2/Odb.hsc view
@@ -0,0 +1,28 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Odb where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+import Bindings.Libgit2.OdbBackend+#ccall git_odb_new , Ptr (Ptr <git_odb>) -> IO (CInt)+#ccall git_odb_open , Ptr (Ptr <git_odb>) -> CString -> IO (CInt)+#ccall git_odb_add_backend , Ptr <git_odb> -> Ptr <git_odb_backend> -> CInt -> IO (CInt)+#ccall git_odb_add_alternate , Ptr <git_odb> -> Ptr <git_odb_backend> -> CInt -> IO (CInt)+#ccall git_odb_free , Ptr <git_odb> -> IO ()+#ccall git_odb_read , Ptr (Ptr <git_odb_object>) -> Ptr <git_odb> -> Ptr <git_oid> -> IO (CInt)+#ccall git_odb_read_prefix , Ptr (Ptr <git_odb_object>) -> Ptr <git_odb> -> Ptr <git_oid> -> CUInt -> IO (CInt)+#ccall git_odb_read_header , Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb> -> Ptr <git_oid> -> IO (CInt)+#ccall git_odb_exists , Ptr <git_odb> -> Ptr <git_oid> -> IO (CInt)+#ccall git_odb_write , Ptr <git_oid> -> Ptr <git_odb> -> Ptr () -> CSize -> <git_otype> -> IO (CInt)+#ccall git_odb_open_wstream , Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb> -> CSize -> <git_otype> -> IO (CInt)+#ccall git_odb_open_rstream , Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb> -> Ptr <git_oid> -> IO (CInt)+#ccall git_odb_hash , Ptr <git_oid> -> Ptr () -> CSize -> <git_otype> -> IO (CInt)+#ccall git_odb_hashfile , Ptr <git_oid> -> CString -> <git_otype> -> IO (CInt)+#ccall git_odb_object_free , Ptr <git_odb_object> -> IO ()+#ccall git_odb_object_id , Ptr <git_odb_object> -> IO (Ptr <git_oid>)+#ccall git_odb_object_data , Ptr <git_odb_object> -> IO (Ptr ())+#ccall git_odb_object_size , Ptr <git_odb_object> -> IO (CSize)+#ccall git_odb_object_type , Ptr <git_odb_object> -> IO (<git_otype>)
+ Bindings/Libgit2/OdbBackend.hsc view
@@ -0,0 +1,83 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.OdbBackend where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+{- struct git_odb_backend {+ git_odb * odb;+ int (* read)(void * *,+ size_t *,+ git_otype *,+ struct git_odb_backend *,+ const git_oid *);+ int (* read_prefix)(git_oid *,+ void * *,+ size_t *,+ git_otype *,+ struct git_odb_backend *,+ const git_oid *,+ unsigned int);+ int (* read_header)(size_t *,+ git_otype *,+ struct git_odb_backend *,+ const git_oid *);+ int (* write)(git_oid *,+ struct git_odb_backend *,+ const void *,+ size_t,+ git_otype);+ int (* writestream)(struct git_odb_stream * *,+ struct git_odb_backend *,+ size_t,+ git_otype);+ int (* readstream)(struct git_odb_stream * *,+ struct git_odb_backend *,+ const git_oid *);+ int (* exists)(struct git_odb_backend *, const git_oid *);+ void (* free)(struct git_odb_backend *);+}; -}+#starttype git_odb_backend+#field odb , Ptr <git_odb>+#field read , FunPtr (Ptr (Ptr ()) -> Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)+#field read_prefix , FunPtr (Ptr <git_oid> -> Ptr (Ptr ()) -> Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CUInt -> CInt)+#field read_header , FunPtr (Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)+#field write , FunPtr (Ptr <git_oid> -> Ptr <git_odb_backend> -> Ptr () -> CSize -> <git_otype> -> CInt)+#field writestream , FunPtr (Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb_backend> -> CSize -> <git_otype> -> CInt)+#field readstream , FunPtr (Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)+#field exists , FunPtr (Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)+#field free , FunPtr (Ptr <git_odb_backend>)+#stoptype+{- enum {+ GIT_STREAM_RDONLY = 1 << 1,+ GIT_STREAM_WRONLY = 1 << 2,+ GIT_STREAM_RW = GIT_STREAM_RDONLY | GIT_STREAM_WRONLY+}; -}+#num GIT_STREAM_RDONLY+#num GIT_STREAM_WRONLY+#num GIT_STREAM_RW+{- struct git_odb_stream {+ struct git_odb_backend * backend;+ int mode;+ int (* read)(struct git_odb_stream * stream,+ char * buffer,+ size_t len);+ int (* write)(struct git_odb_stream * stream,+ const char * buffer,+ size_t len);+ int (* finalize_write)(git_oid * oid_p,+ struct git_odb_stream * stream);+ void (* free)(struct git_odb_stream * stream);+}; -}+#starttype git_odb_stream+#field backend , Ptr <git_odb_backend>+#field mode , CInt+#field read , FunPtr (Ptr <git_odb_stream> -> CString -> CSize -> CInt)+#field write , FunPtr (Ptr <git_odb_stream> -> CString -> CSize -> CInt)+#field finalize_write , FunPtr (Ptr <git_oid> -> Ptr <git_odb_stream> -> CInt)+#field free , FunPtr (Ptr <git_odb_stream>)+#stoptype+#ccall git_odb_backend_pack , Ptr (Ptr <git_odb_backend>) -> CString -> IO (CInt)+#ccall git_odb_backend_loose , Ptr (Ptr <git_odb_backend>) -> CString -> CInt -> CInt -> IO (CInt)
+ Bindings/Libgit2/Oid.hsc view
@@ -0,0 +1,33 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Oid where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+#num GIT_OID_RAWSZ+#num GIT_OID_HEXSZ+#num GIT_OID_MINPREFIXLEN+{- struct _git_oid {+ unsigned char id[20];+}; -}+#starttype git_oid+#array_field id , CUChar+#stoptype+#ccall git_oid_fromstr , Ptr <git_oid> -> CString -> IO (CInt)+#ccall git_oid_fromstrn , Ptr <git_oid> -> CString -> CSize -> IO (CInt)+#ccall git_oid_fromraw , Ptr <git_oid> -> Ptr CUChar -> IO ()+#ccall git_oid_fmt , CString -> Ptr <git_oid> -> IO ()+#ccall git_oid_pathfmt , CString -> Ptr <git_oid> -> IO ()+#ccall git_oid_allocfmt , Ptr <git_oid> -> IO (CString)+#ccall git_oid_tostr , CString -> CSize -> Ptr <git_oid> -> IO (CString)+#ccall git_oid_cpy , Ptr <git_oid> -> Ptr <git_oid> -> IO ()+#ccall git_oid_cmp , Ptr <git_oid> -> Ptr <git_oid> -> IO (CInt)+#ccall git_oid_ncmp , Ptr <git_oid> -> Ptr <git_oid> -> CUInt -> IO (CInt)+#ccall git_oid_streq , Ptr <git_oid> -> CString -> IO (CInt)+#ccall git_oid_iszero , Ptr <git_oid> -> IO (CInt)+{- typedef struct git_oid_shorten git_oid_shorten; -}+#opaque_t git_oid_shorten+#ccall git_oid_shorten_new , CSize -> IO (Ptr <git_oid_shorten>)+#ccall git_oid_shorten_add , Ptr <git_oid_shorten> -> CString -> IO (CInt)+#ccall git_oid_shorten_free , Ptr <git_oid_shorten> -> IO ()
+ Bindings/Libgit2/Reflog.hsc view
@@ -0,0 +1,19 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Reflog where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+#ccall git_reflog_read , Ptr (Ptr <git_reflog>) -> Ptr <git_reference> -> IO (CInt)+#ccall git_reflog_write , Ptr <git_reference> -> Ptr <git_oid> -> Ptr <git_signature> -> CString -> IO (CInt)+#ccall git_reflog_rename , Ptr <git_reference> -> CString -> IO (CInt)+#ccall git_reflog_delete , Ptr <git_reference> -> IO (CInt)+#ccall git_reflog_entrycount , Ptr <git_reflog> -> IO (CUInt)+#ccall git_reflog_entry_byindex , Ptr <git_reflog> -> CUInt -> IO (Ptr <git_reflog_entry>)+#ccall git_reflog_entry_oidold , Ptr <git_reflog_entry> -> IO (Ptr <git_oid>)+#ccall git_reflog_entry_oidnew , Ptr <git_reflog_entry> -> IO (Ptr <git_oid>)+#ccall git_reflog_entry_committer , Ptr <git_reflog_entry> -> IO (Ptr <git_signature>)+#ccall git_reflog_entry_msg , Ptr <git_reflog_entry> -> IO (CString)+#ccall git_reflog_free , Ptr <git_reflog> -> IO ()
+ Bindings/Libgit2/Refs.hsc view
@@ -0,0 +1,29 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Refs where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+#ccall git_reference_lookup , Ptr (Ptr <git_reference>) -> Ptr <git_repository> -> CString -> IO (CInt)+#ccall git_reference_name_to_oid , Ptr <git_oid> -> Ptr <git_repository> -> CString -> IO (CInt)+#ccall git_reference_create_symbolic , Ptr (Ptr <git_reference>) -> Ptr <git_repository> -> CString -> CString -> CInt -> IO (CInt)+#ccall git_reference_create_oid , Ptr (Ptr <git_reference>) -> Ptr <git_repository> -> CString -> Ptr <git_oid> -> CInt -> IO (CInt)+#ccall git_reference_oid , Ptr <git_reference> -> IO (Ptr <git_oid>)+#ccall git_reference_target , Ptr <git_reference> -> IO (CString)+#ccall git_reference_type , Ptr <git_reference> -> IO (<git_ref_t>)+#ccall git_reference_name , Ptr <git_reference> -> IO (CString)+#ccall git_reference_resolve , Ptr (Ptr <git_reference>) -> Ptr <git_reference> -> IO (CInt)+#ccall git_reference_owner , Ptr <git_reference> -> IO (Ptr <git_repository>)+#ccall git_reference_set_target , Ptr <git_reference> -> CString -> IO (CInt)+#ccall git_reference_set_oid , Ptr <git_reference> -> Ptr <git_oid> -> IO (CInt)+#ccall git_reference_rename , Ptr <git_reference> -> CString -> CInt -> IO (CInt)+#ccall git_reference_delete , Ptr <git_reference> -> IO (CInt)+#ccall git_reference_packall , Ptr <git_repository> -> IO (CInt)+#ccall git_reference_list , Ptr <git_strarray> -> Ptr <git_repository> -> CUInt -> IO (CInt)+#ccall git_reference_foreach , Ptr <git_repository> -> CUInt -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)+#ccall git_reference_is_packed , Ptr <git_reference> -> IO (CInt)+#ccall git_reference_reload , Ptr <git_reference> -> IO (CInt)+#ccall git_reference_free , Ptr <git_reference> -> IO ()+#ccall git_reference_cmp , Ptr <git_reference> -> Ptr <git_reference> -> IO (CInt)
+ Bindings/Libgit2/Refspec.hsc view
@@ -0,0 +1,11 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Refspec where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+#ccall git_refspec_src , Ptr <git_refspec> -> IO (CString)+#ccall git_refspec_dst , Ptr <git_refspec> -> IO (CString)+#ccall git_refspec_src_matches , Ptr <git_refspec> -> CString -> IO (CInt)+#ccall git_refspec_transform , CString -> CSize -> Ptr <git_refspec> -> CString -> IO (CInt)
+ Bindings/Libgit2/Remote.hsc view
@@ -0,0 +1,32 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Remote where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Repository+import Bindings.Libgit2.Refspec+import Bindings.Libgit2.Net+import Bindings.Libgit2.Indexer+import Bindings.Libgit2.Oid+import Bindings.Libgit2.Types+#ccall git_remote_new , Ptr (Ptr <git_remote>) -> Ptr <git_repository> -> CString -> CString -> CString -> IO (CInt)+#ccall git_remote_load , Ptr (Ptr <git_remote>) -> Ptr <git_repository> -> CString -> IO (CInt)+#ccall git_remote_save , Ptr <git_remote> -> IO (CInt)+#ccall git_remote_name , Ptr <git_remote> -> IO (CString)+#ccall git_remote_url , Ptr <git_remote> -> IO (CString)+#ccall git_remote_set_fetchspec , Ptr <git_remote> -> CString -> IO (CInt)+#ccall git_remote_fetchspec , Ptr <git_remote> -> IO (Ptr <git_refspec>)+#ccall git_remote_set_pushspec , Ptr <git_remote> -> CString -> IO (CInt)+#ccall git_remote_pushspec , Ptr <git_remote> -> IO (Ptr <git_refspec>)+#ccall git_remote_connect , Ptr <git_remote> -> CInt -> IO (CInt)+#ccall git_remote_ls , Ptr <git_remote> -> CInt -> Ptr () -> IO (CInt)+#ccall git_remote_download , Ptr <git_remote> -> Ptr CLong -> Ptr <git_indexer_stats> -> IO (CInt)+#ccall git_remote_connected , Ptr <git_remote> -> IO (CInt)+#ccall git_remote_disconnect , Ptr <git_remote> -> IO ()+#ccall git_remote_free , Ptr <git_remote> -> IO ()+#ccall git_remote_update_tips , Ptr <git_remote> -> FunPtr (CString -> Ptr <git_oid> -> Ptr <git_oid> -> CInt) -> IO (CInt)+#ccall git_remote_valid_url , CString -> IO (CInt)+#ccall git_remote_supported_url , CString -> IO (CInt)+#ccall git_remote_list , Ptr <git_strarray> -> Ptr <git_repository> -> IO (CInt)+#ccall git_remote_add , Ptr (Ptr <git_remote>) -> Ptr <git_repository> -> CString -> CString -> IO (CInt)
+ Bindings/Libgit2/Repository.hsc view
@@ -0,0 +1,33 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Repository where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+#ccall git_repository_open , Ptr (Ptr <git_repository>) -> CString -> IO (CInt)+#ccall git_repository_discover , CString -> CSize -> CString -> CInt -> CString -> IO (CInt)+{- enum {+ GIT_REPOSITORY_OPEN_NO_SEARCH = 1 << 0,+ GIT_REPOSITORY_OPEN_CROSS_FS = 1 << 1+}; -}+#num GIT_REPOSITORY_OPEN_NO_SEARCH+#num GIT_REPOSITORY_OPEN_CROSS_FS+#ccall git_repository_open_ext , Ptr (Ptr <git_repository>) -> CString -> CUInt -> CString -> IO (CInt)+#ccall git_repository_free , Ptr <git_repository> -> IO ()+#ccall git_repository_init , Ptr (Ptr <git_repository>) -> CString -> CUInt -> IO (CInt)+#ccall git_repository_head , Ptr (Ptr <git_reference>) -> Ptr <git_repository> -> IO (CInt)+#ccall git_repository_head_detached , Ptr <git_repository> -> IO (CInt)+#ccall git_repository_head_orphan , Ptr <git_repository> -> IO (CInt)+#ccall git_repository_is_empty , Ptr <git_repository> -> IO (CInt)+#ccall git_repository_path , Ptr <git_repository> -> IO (CString)+#ccall git_repository_workdir , Ptr <git_repository> -> IO (CString)+#ccall git_repository_set_workdir , Ptr <git_repository> -> CString -> IO (CInt)+#ccall git_repository_is_bare , Ptr <git_repository> -> IO (CInt)+#ccall git_repository_config , Ptr (Ptr <git_config>) -> Ptr <git_repository> -> IO (CInt)+#ccall git_repository_set_config , Ptr <git_repository> -> Ptr <git_config> -> IO ()+#ccall git_repository_odb , Ptr (Ptr <git_odb>) -> Ptr <git_repository> -> IO (CInt)+#ccall git_repository_set_odb , Ptr <git_repository> -> Ptr <git_odb> -> IO ()+#ccall git_repository_index , Ptr (Ptr <git_index>) -> Ptr <git_repository> -> IO (CInt)+#ccall git_repository_set_index , Ptr <git_repository> -> Ptr <git_index> -> IO ()
+ Bindings/Libgit2/Revwalk.hsc view
@@ -0,0 +1,22 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Revwalk where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+#ccall git_revwalk_new , Ptr (Ptr <git_revwalk>) -> Ptr <git_repository> -> IO (CInt)+#ccall git_revwalk_reset , Ptr <git_revwalk> -> IO ()+#ccall git_revwalk_push , Ptr <git_revwalk> -> Ptr <git_oid> -> IO (CInt)+#ccall git_revwalk_push_glob , Ptr <git_revwalk> -> CString -> IO (CInt)+#ccall git_revwalk_push_head , Ptr <git_revwalk> -> IO (CInt)+#ccall git_revwalk_hide , Ptr <git_revwalk> -> Ptr <git_oid> -> IO (CInt)+#ccall git_revwalk_hide_glob , Ptr <git_revwalk> -> CString -> IO (CInt)+#ccall git_revwalk_hide_head , Ptr <git_revwalk> -> IO (CInt)+#ccall git_revwalk_push_ref , Ptr <git_revwalk> -> CString -> IO (CInt)+#ccall git_revwalk_hide_ref , Ptr <git_revwalk> -> CString -> IO (CInt)+#ccall git_revwalk_next , Ptr <git_oid> -> Ptr <git_revwalk> -> IO (CInt)+#ccall git_revwalk_sorting , Ptr <git_revwalk> -> CUInt -> IO ()+#ccall git_revwalk_free , Ptr <git_revwalk> -> IO ()+#ccall git_revwalk_repository , Ptr <git_revwalk> -> IO (Ptr <git_repository>)
+ Bindings/Libgit2/Signature.hsc view
@@ -0,0 +1,11 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Signature where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+#ccall git_signature_new , Ptr (Ptr <git_signature>) -> CString -> CString -> CLong -> CInt -> IO (CInt)+#ccall git_signature_now , Ptr (Ptr <git_signature>) -> CString -> CString -> IO (CInt)+#ccall git_signature_dup , Ptr <git_signature> -> IO (Ptr <git_signature>)+#ccall git_signature_free , Ptr <git_signature> -> IO ()
+ Bindings/Libgit2/Status.hsc view
@@ -0,0 +1,60 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Status where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+{- enum {+ GIT_STATUS_CURRENT = 0,+ GIT_STATUS_INDEX_NEW = 1 << 0,+ GIT_STATUS_INDEX_MODIFIED = 1 << 1,+ GIT_STATUS_INDEX_DELETED = 1 << 2,+ GIT_STATUS_WT_NEW = 1 << 3,+ GIT_STATUS_WT_MODIFIED = 1 << 4,+ GIT_STATUS_WT_DELETED = 1 << 5,+ GIT_STATUS_IGNORED = 1 << 6+}; -}+#num GIT_STATUS_CURRENT+#num GIT_STATUS_INDEX_NEW+#num GIT_STATUS_INDEX_MODIFIED+#num GIT_STATUS_INDEX_DELETED+#num GIT_STATUS_WT_NEW+#num GIT_STATUS_WT_MODIFIED+#num GIT_STATUS_WT_DELETED+#num GIT_STATUS_IGNORED+#ccall git_status_foreach , Ptr <git_repository> -> FunPtr (CString -> CUInt -> Ptr () -> CInt) -> Ptr () -> IO (CInt)+{- typedef enum {+ GIT_STATUS_SHOW_INDEX_AND_WORKDIR = 0,+ GIT_STATUS_SHOW_INDEX_ONLY = 1,+ GIT_STATUS_SHOW_WORKDIR_ONLY = 2,+ GIT_STATUS_SHOW_INDEX_THEN_WORKDIR = 3+ } git_status_show_t; -}+#integral_t git_status_show_t+#num GIT_STATUS_SHOW_INDEX_AND_WORKDIR+#num GIT_STATUS_SHOW_INDEX_ONLY+#num GIT_STATUS_SHOW_WORKDIR_ONLY+#num GIT_STATUS_SHOW_INDEX_THEN_WORKDIR+{- enum {+ GIT_STATUS_OPT_INCLUDE_UNTRACKED = 1 << 0,+ GIT_STATUS_OPT_INCLUDE_IGNORED = 1 << 1,+ GIT_STATUS_OPT_INCLUDE_UNMODIFIED = 1 << 2,+ GIT_STATUS_OPT_EXCLUDE_SUBMODULED = 1 << 3,+ GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS = 1 << 4+}; -}+#num GIT_STATUS_OPT_INCLUDE_UNTRACKED+#num GIT_STATUS_OPT_INCLUDE_IGNORED+#num GIT_STATUS_OPT_INCLUDE_UNMODIFIED+#num GIT_STATUS_OPT_EXCLUDE_SUBMODULED+#num GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS+{- typedef struct {+ git_status_show_t show; unsigned int flags; git_strarray pathspec;+ } git_status_options; -}+#starttype git_status_options+#field show , <git_status_show_t>+#field flags , CUInt+#field pathspec , <git_strarray>+#stoptype+#ccall git_status_foreach_ext , Ptr <git_repository> -> Ptr <git_status_options> -> FunPtr (CString -> CUInt -> Ptr () -> CInt) -> Ptr () -> IO (CInt)+#ccall git_status_file , Ptr CUInt -> Ptr <git_repository> -> CString -> IO (CInt)+#ccall git_status_should_ignore , Ptr CInt -> Ptr <git_repository> -> CString -> IO (CInt)
+ Bindings/Libgit2/Submodule.hsc view
@@ -0,0 +1,50 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Submodule where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+{- typedef enum {+ GIT_SUBMODULE_UPDATE_CHECKOUT = 0,+ GIT_SUBMODULE_UPDATE_REBASE = 1,+ GIT_SUBMODULE_UPDATE_MERGE = 2+ } git_submodule_update_t; -}+#integral_t git_submodule_update_t+#num GIT_SUBMODULE_UPDATE_CHECKOUT+#num GIT_SUBMODULE_UPDATE_REBASE+#num GIT_SUBMODULE_UPDATE_MERGE+{- typedef enum {+ GIT_SUBMODULE_IGNORE_ALL = 0,+ GIT_SUBMODULE_IGNORE_DIRTY = 1,+ GIT_SUBMODULE_IGNORE_UNTRACKED = 2,+ GIT_SUBMODULE_IGNORE_NONE = 3+ } git_submodule_ignore_t; -}+#integral_t git_submodule_ignore_t+#num GIT_SUBMODULE_IGNORE_ALL+#num GIT_SUBMODULE_IGNORE_DIRTY+#num GIT_SUBMODULE_IGNORE_UNTRACKED+#num GIT_SUBMODULE_IGNORE_NONE+{- typedef struct {+ char * name;+ char * path;+ char * url;+ git_oid oid;+ git_submodule_update_t update;+ git_submodule_ignore_t ignore;+ int fetch_recurse;+ int refcount;+ } git_submodule; -}+#starttype git_submodule+#field name , CString+#field path , CString+#field url , CString+#field oid , <git_oid>+#field update , <git_submodule_update_t>+#field ignore , <git_submodule_ignore_t>+#field fetch_recurse , CInt+#field refcount , CInt+#stoptype+#ccall git_submodule_foreach , Ptr <git_repository> -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)+#ccall git_submodule_lookup , Ptr (Ptr <git_submodule>) -> Ptr <git_repository> -> CString -> IO (CInt)
+ Bindings/Libgit2/Tag.hsc view
@@ -0,0 +1,26 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Tag where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+import Bindings.Libgit2.Object+#cinline git_tag_lookup , Ptr (Ptr <git_tag>) -> Ptr <git_repository> -> Ptr <git_oid> -> IO (CInt)+#cinline git_tag_lookup_prefix , Ptr (Ptr <git_tag>) -> Ptr <git_repository> -> Ptr <git_oid> -> CUInt -> IO (CInt)+#cinline git_tag_free , Ptr <git_tag> -> IO ()+#ccall git_tag_id , Ptr <git_tag> -> IO (Ptr <git_oid>)+#ccall git_tag_target , Ptr (Ptr <git_object>) -> Ptr <git_tag> -> IO (CInt)+#ccall git_tag_target_oid , Ptr <git_tag> -> IO (Ptr <git_oid>)+#ccall git_tag_type , Ptr <git_tag> -> IO (<git_otype>)+#ccall git_tag_name , Ptr <git_tag> -> IO (CString)+#ccall git_tag_tagger , Ptr <git_tag> -> IO (Ptr <git_signature>)+#ccall git_tag_message , Ptr <git_tag> -> IO (CString)+#ccall git_tag_create , Ptr <git_oid> -> Ptr <git_repository> -> CString -> Ptr <git_object> -> Ptr <git_signature> -> CString -> CInt -> IO (CInt)+#ccall git_tag_create_frombuffer , Ptr <git_oid> -> Ptr <git_repository> -> CString -> CInt -> IO (CInt)+#ccall git_tag_create_lightweight , Ptr <git_oid> -> Ptr <git_repository> -> CString -> Ptr <git_object> -> CInt -> IO (CInt)+#ccall git_tag_delete , Ptr <git_repository> -> CString -> IO (CInt)+#ccall git_tag_list , Ptr <git_strarray> -> Ptr <git_repository> -> IO (CInt)+#ccall git_tag_list_match , Ptr <git_strarray> -> CString -> Ptr <git_repository> -> IO (CInt)+#ccall git_tag_peel , Ptr (Ptr <git_object>) -> Ptr <git_tag> -> IO (CInt)
+ Bindings/Libgit2/Tag.hsc.helper.c view
@@ -0,0 +1,6 @@+#include <bindings.cmacros.h>+#include <git2.h>++BC_INLINE3(git_tag_lookup, git_tag**, git_repository*, const git_oid*, int)+BC_INLINE4(git_tag_lookup_prefix, git_tag**, git_repository*, const git_oid*, unsigned int, int)+BC_INLINE1VOID(git_tag_free, git_tag*)
+ Bindings/Libgit2/Threads.hsc view
@@ -0,0 +1,8 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Threads where+#strict_import++import Bindings.Libgit2.Common+#ccall git_threads_init , IO ()+#ccall git_threads_shutdown , IO ()
+ Bindings/Libgit2/Tree.hsc view
@@ -0,0 +1,42 @@+#include <bindings.dsl.h>+#include <git2.h>+#include <git2/tree.h>+module Bindings.Libgit2.Tree where+#strict_import++import Bindings.Libgit2.Common+import Bindings.Libgit2.Types+import Bindings.Libgit2.Oid+import Bindings.Libgit2.Object+#cinline git_tree_lookup , Ptr (Ptr <git_tree>) -> Ptr <git_repository> -> Ptr <git_oid> -> IO (CInt)+#cinline git_tree_lookup_prefix , Ptr (Ptr <git_tree>) -> Ptr <git_repository> -> Ptr <git_oid> -> CUInt -> IO (CInt)+#cinline git_tree_free , Ptr <git_tree> -> IO ()+#ccall git_tree_id , Ptr <git_tree> -> IO (Ptr <git_oid>)+#ccall git_tree_entrycount , Ptr <git_tree> -> IO (CUInt)+#ccall git_tree_entry_byname , Ptr <git_tree> -> CString -> IO (Ptr <git_tree_entry>)+#ccall git_tree_entry_byindex , Ptr <git_tree> -> CUInt -> IO (Ptr <git_tree_entry>)+#ccall git_tree_entry_attributes , Ptr <git_tree_entry> -> IO (CUInt)+#ccall git_tree_entry_name , Ptr <git_tree_entry> -> IO (CString)+#ccall git_tree_entry_id , Ptr <git_tree_entry> -> IO (Ptr <git_oid>)+#ccall git_tree_entry_type , Ptr <git_tree_entry> -> IO (<git_otype>)+#ccall git_tree_entry_to_object , Ptr (Ptr <git_object>) -> Ptr <git_repository> -> Ptr <git_tree_entry> -> IO (CInt)+#ccall git_tree_create_fromindex , Ptr <git_oid> -> Ptr <git_index> -> IO (CInt)+#ccall git_treebuilder_create , Ptr (Ptr <git_treebuilder>) -> Ptr <git_tree> -> IO (CInt)+#ccall git_treebuilder_clear , Ptr <git_treebuilder> -> IO ()+#ccall git_treebuilder_free , Ptr <git_treebuilder> -> IO ()+#ccall git_treebuilder_get , Ptr <git_treebuilder> -> CString -> IO (Ptr <git_tree_entry>)+#ccall git_treebuilder_insert , Ptr (Ptr <git_tree_entry>) -> Ptr <git_treebuilder> -> CString -> Ptr <git_oid> -> CUInt -> IO (CInt)+#ccall git_treebuilder_remove , Ptr <git_treebuilder> -> CString -> IO (CInt)+#ccall git_treebuilder_filter , Ptr <git_treebuilder> -> FunPtr (Ptr <git_tree_entry> -> Ptr () -> CInt) -> Ptr () -> IO ()+#ccall git_treebuilder_write , Ptr <git_oid> -> Ptr <git_repository> -> Ptr <git_treebuilder> -> IO (CInt)+#ccall git_tree_get_subtree , Ptr (Ptr <git_tree>) -> Ptr <git_tree> -> CString -> IO (CInt)+{- typedef int (* git_treewalk_cb)(const char * root,+ git_tree_entry * entry,+ void * payload); -}+#synonym_t git_treewalk_cb , CInt+{- enum git_treewalk_mode {+ GIT_TREEWALK_PRE = 0, GIT_TREEWALK_POST = 1+}; -}+#num GIT_TREEWALK_PRE+#num GIT_TREEWALK_POST+#ccall git_tree_walk , Ptr <git_tree> -> CInt -> CInt -> Ptr () -> IO (CInt)
+ Bindings/Libgit2/Tree.hsc.helper.c view
@@ -0,0 +1,6 @@+#include <bindings.cmacros.h>+#include <git2.h>++BC_INLINE3(git_tree_lookup, git_tree**, git_repository*, const git_oid*, int)+BC_INLINE4(git_tree_lookup_prefix, git_tree**, git_repository*, const git_oid*, unsigned int, int)+BC_INLINE1VOID(git_tree_free, git_tree*)
+ Bindings/Libgit2/Types.hsc view
@@ -0,0 +1,115 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Types where+#strict_import++import Bindings.Libgit2.Common+{- typedef int64_t git_off_t; -}+#synonym_t git_off_t , CLong+{- typedef int64_t git_time_t; -}+#synonym_t git_time_t , CLong+{- typedef enum {+ GIT_OBJ_ANY = -2,+ GIT_OBJ_BAD = -1,+ GIT_OBJ__EXT1 = 0,+ GIT_OBJ_COMMIT = 1,+ GIT_OBJ_TREE = 2,+ GIT_OBJ_BLOB = 3,+ GIT_OBJ_TAG = 4,+ GIT_OBJ__EXT2 = 5,+ GIT_OBJ_OFS_DELTA = 6,+ GIT_OBJ_REF_DELTA = 7+ } git_otype; -}+#integral_t git_otype+#num GIT_OBJ_ANY+#num GIT_OBJ_BAD+#num GIT_OBJ__EXT1+#num GIT_OBJ_COMMIT+#num GIT_OBJ_TREE+#num GIT_OBJ_BLOB+#num GIT_OBJ_TAG+#num GIT_OBJ__EXT2+#num GIT_OBJ_OFS_DELTA+#num GIT_OBJ_REF_DELTA+{- typedef struct git_odb git_odb; -}+#opaque_t git_odb+-- {- typedef struct git_odb_backend git_odb_backend; -}+-- #opaque_t git_odb_backend+{- typedef struct git_odb_object git_odb_object; -}+#opaque_t git_odb_object+-- {- typedef struct git_odb_stream git_odb_stream; -}+-- #opaque_t git_odb_stream+{- typedef struct git_repository git_repository; -}+#opaque_t git_repository+{- typedef struct git_object git_object; -}+#opaque_t git_object+{- typedef struct git_revwalk git_revwalk; -}+#opaque_t git_revwalk+{- typedef struct git_tag git_tag; -}+#opaque_t git_tag+{- typedef struct git_blob git_blob; -}+#opaque_t git_blob+{- typedef struct git_commit git_commit; -}+#opaque_t git_commit+{- typedef struct git_tree_entry git_tree_entry; -}+#opaque_t git_tree_entry+{- typedef struct git_tree git_tree; -}+#opaque_t git_tree+{- typedef struct git_treebuilder git_treebuilder; -}+#opaque_t git_treebuilder+{- typedef struct git_index git_index; -}+#opaque_t git_index+{- typedef struct git_config git_config; -}+#opaque_t git_config+-- {- typedef struct git_config_file git_config_file; -}+-- #opaque_t git_config_file+{- typedef struct git_reflog_entry git_reflog_entry; -}+#opaque_t git_reflog_entry+{- typedef struct git_reflog git_reflog; -}+#opaque_t git_reflog+{- typedef struct git_note git_note; -}+#opaque_t git_note+{- typedef struct git_time {+ git_time_t time; int offset;+ } git_time; -}+#starttype git_time+#field time , CLong+#field offset , CInt+#stoptype+{- typedef struct git_signature {+ char * name; char * email; git_time when;+ } git_signature; -}+#starttype git_signature+#field name , CString+#field email , CString+#field when , <git_time>+#stoptype+{- typedef struct git_reference git_reference; -}+#opaque_t git_reference+{- typedef enum {+ GIT_REF_INVALID = 0,+ GIT_REF_OID = 1,+ GIT_REF_SYMBOLIC = 2,+ GIT_REF_PACKED = 4,+ GIT_REF_HAS_PEEL = 8,+ GIT_REF_LISTALL = GIT_REF_OID | GIT_REF_SYMBOLIC | GIT_REF_PACKED+ } git_ref_t; -}+#integral_t git_ref_t+#num GIT_REF_INVALID+#num GIT_REF_OID+#num GIT_REF_SYMBOLIC+#num GIT_REF_PACKED+#num GIT_REF_HAS_PEEL+#num GIT_REF_LISTALL+{- typedef enum {+ GIT_BRANCH_LOCAL = 1, GIT_BRANCH_REMOTE = 2+ } git_branch_t; -}+#integral_t git_branch_t+#num GIT_BRANCH_LOCAL+#num GIT_BRANCH_REMOTE+{- typedef struct git_refspec git_refspec; -}+#opaque_t git_refspec+{- typedef struct git_remote git_remote; -}+#opaque_t git_remote+-- {- typedef struct git_remote_head git_remote_head; -}+-- #opaque_t git_remote_head
+ Bindings/Libgit2/Version.hsc view
@@ -0,0 +1,5 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Version where+#strict_import+
+ Bindings/Libgit2/Windows.hsc view
@@ -0,0 +1,9 @@+#include <bindings.dsl.h>+#include <git2.h>+module Bindings.Libgit2.Windows where+#strict_import++import Bindings.Libgit2.Common+#ccall gitwin_set_codepage , CUInt -> IO ()+#ccall gitwin_get_codepage , IO (CUInt)+#ccall gitwin_set_utf8 , IO ()
LICENSE view
@@ -1,3 +1,4 @@+Copyright (c) 2012 John Wiegley Copyright (c) 2011 Sakari Jokinen, Jacob Stanley Permission is hereby granted, free of charge, to any person obtaining a copy
hlibgit2.cabal view
@@ -1,5 +1,5 @@ Name: hlibgit2-Version: 0.5.0+Version: 0.6.0 Synopsis: Low-level bindings to libgit2. Description: Bindings to libgit2 v0.16.0-471-g5b9fac3 License-file: LICENSE@@ -32,13 +32,6 @@ base >=3 , hlibgit2 , process- , system-filepath >= 0.4.7- , system-fileio >= 0.3.9- , time >= 1.4- , text >= 0.11.2- , containers >= 0.4.2- , bytestring >= 0.9.2.1- , lens >= 2.8 Library default-language: Haskell98@@ -47,13 +40,6 @@ build-depends: base >= 3 && < 5 , bindings-DSL >= 1.0.11- , system-filepath >= 0.4.7- , system-fileio >= 0.3.9- , time >= 1.4- , text >= 0.11.2- , containers >= 0.4.2- , bytestring >= 0.9.2.1- , lens >= 2.8 exposed-modules: Bindings.Libgit2 Bindings.Libgit2.Attr@@ -88,28 +74,14 @@ Bindings.Libgit2.Types Bindings.Libgit2.Version Bindings.Libgit2.Windows- Data.Git- Data.Git.Blob- Data.Git.Commit- Data.Git.Common- Data.Git.Errors- Data.Git.Object- Data.Git.Oid- Data.Git.Repository- Data.Git.Tag- Data.Git.Tree- other-modules:- Data.Git.Internal- Data.Git.Stringable c-sources:- src/Bindings/Libgit2/Attr.hsc.helper.c- src/Bindings/Libgit2/Blob.hsc.helper.c- src/Bindings/Libgit2/Commit.hsc.helper.c- src/Bindings/Libgit2/Common.hsc.helper.c- src/Bindings/Libgit2/Tag.hsc.helper.c- src/Bindings/Libgit2/Tree.hsc.helper.c+ Bindings/Libgit2/Attr.hsc.helper.c+ Bindings/Libgit2/Blob.hsc.helper.c+ Bindings/Libgit2/Commit.hsc.helper.c+ Bindings/Libgit2/Common.hsc.helper.c+ Bindings/Libgit2/Tag.hsc.helper.c+ Bindings/Libgit2/Tree.hsc.helper.c - hs-source-dirs: src include-dirs: libgit2/include extra-libraries: git2 if os(windows)
− src/Bindings/Libgit2.hs
@@ -1,42 +0,0 @@--module Bindings.Libgit2 (- module Bindings.Libgit2.Repository,- module Bindings.Libgit2.Config,- module Bindings.Libgit2.Types,- module Bindings.Libgit2.Revwalk,- module Bindings.Libgit2.OdbBackend,- module Bindings.Libgit2.Tag,- module Bindings.Libgit2.Net,- module Bindings.Libgit2.Refs,- module Bindings.Libgit2.Refspec,- module Bindings.Libgit2.Reflog,- module Bindings.Libgit2.Commit,- module Bindings.Libgit2.Index,- module Bindings.Libgit2.Signature,- module Bindings.Libgit2.Blob,- module Bindings.Libgit2.Errors,- module Bindings.Libgit2.Oid,- module Bindings.Libgit2.Tree,- module Bindings.Libgit2.Odb,- module Bindings.Libgit2.Common,- module Bindings.Libgit2.Object) where-import Bindings.Libgit2.Repository-import Bindings.Libgit2.Config-import Bindings.Libgit2.Types-import Bindings.Libgit2.Revwalk-import Bindings.Libgit2.OdbBackend-import Bindings.Libgit2.Tag-import Bindings.Libgit2.Net-import Bindings.Libgit2.Refs-import Bindings.Libgit2.Refspec-import Bindings.Libgit2.Reflog-import Bindings.Libgit2.Commit-import Bindings.Libgit2.Index-import Bindings.Libgit2.Signature-import Bindings.Libgit2.Blob-import Bindings.Libgit2.Errors-import Bindings.Libgit2.Oid-import Bindings.Libgit2.Tree-import Bindings.Libgit2.Odb-import Bindings.Libgit2.Common-import Bindings.Libgit2.Object
− src/Bindings/Libgit2/Attr.hsc
@@ -1,18 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-#include <git2/attr.h>-module Bindings.Libgit2.Attr where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types--{- extern __attribute__((visibility("default"))) const char * git_attr__true; -}-{- extern __attribute__((visibility("default"))) const char * git_attr__false; -}-{- extern __attribute__((visibility("default"))) const char * git_attr__unset; -}--#ccall git_attr_get , Ptr (CString) -> Ptr <git_repository> -> CUInt -> CString -> CString -> IO (CInt)-#ccall git_attr_get_many , Ptr (CString) -> Ptr <git_repository> -> CUInt -> CString -> CSize -> Ptr (CString) -> IO (CInt)-#ccall git_attr_foreach , Ptr <git_repository> -> CUInt -> CString -> FunPtr (CString -> CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)-#ccall git_attr_cache_flush , Ptr <git_repository> -> IO ()-#ccall git_attr_add_macro , Ptr <git_repository> -> CString -> CString -> IO (CInt)
− src/Bindings/Libgit2/Attr.hsc.helper.c
@@ -1,7 +0,0 @@-#include <bindings.cmacros.h>-#include <git2/attr.h>--BC_INLINE1(GIT_ATTR_TRUE, const char *, int)-BC_INLINE1(GIT_ATTR_FALSE, const char *, int)-BC_INLINE1(GIT_ATTR_UNSPECIFIED, const char *, int)-BC_INLINE1(GIT_ATTR_HAS_VALUE, const char *, int)
− src/Bindings/Libgit2/Blob.hsc
@@ -1,17 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Blob where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-import Bindings.Libgit2.Object-#cinline git_blob_lookup , Ptr (Ptr <git_blob>) -> Ptr <git_repository> -> Ptr <git_oid> -> IO (CInt)-#cinline git_blob_lookup_prefix , Ptr (Ptr <git_blob>) -> Ptr <git_repository> -> Ptr <git_oid> -> CUInt -> IO (CInt)-#cinline git_blob_free , Ptr <git_blob> -> IO ()-#ccall git_blob_rawcontent , Ptr <git_blob> -> IO (Ptr ())-#ccall git_blob_rawsize , Ptr <git_blob> -> IO (CSize)-#ccall git_blob_create_fromfile , Ptr <git_oid> -> Ptr <git_repository> -> CString -> IO (CInt)-#ccall git_blob_create_fromdisk , Ptr <git_oid> -> Ptr <git_repository> -> CString -> IO (CInt)-#ccall git_blob_create_frombuffer , Ptr <git_oid> -> Ptr <git_repository> -> Ptr () -> CSize -> IO (CInt)
− src/Bindings/Libgit2/Blob.hsc.helper.c
@@ -1,6 +0,0 @@-#include <bindings.cmacros.h>-#include <git2.h>--BC_INLINE3(git_blob_lookup, git_blob * *, git_repository *, const git_oid *, int)-BC_INLINE4(git_blob_lookup_prefix, git_blob * *, git_repository *, const git_oid *, unsigned int, int)-BC_INLINE1VOID(git_blob_free, git_blob *)
− src/Bindings/Libgit2/Branch.hsc
@@ -1,12 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Branch where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Oid-import Bindings.Libgit2.Types-#ccall git_branch_create , Ptr <git_oid> -> Ptr <git_repository> -> CString -> Ptr <git_object> -> CInt -> IO (CInt)-#ccall git_branch_delete , Ptr <git_repository> -> CString -> <git_branch_t> -> IO (CInt)-#ccall git_branch_list , Ptr <git_strarray> -> Ptr <git_repository> -> CUInt -> IO (CInt)-#ccall git_branch_move , Ptr <git_repository> -> CString -> CString -> CInt -> IO (CInt)
− src/Bindings/Libgit2/Commit.hsc
@@ -1,25 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Commit where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-import Bindings.Libgit2.Object-#cinline git_commit_lookup , Ptr (Ptr <git_commit>) -> Ptr <git_repository> -> Ptr <git_oid> -> IO (CInt)-#cinline git_commit_lookup_prefix , Ptr (Ptr <git_commit>) -> Ptr <git_repository> -> Ptr <git_oid> -> CUInt -> IO (CInt)-#cinline git_commit_free , Ptr <git_commit> -> IO ()-#ccall git_commit_id , Ptr <git_commit> -> IO (Ptr <git_oid>)-#ccall git_commit_message_encoding , Ptr <git_commit> -> IO (CString)-#ccall git_commit_message , Ptr <git_commit> -> IO (CString)-#ccall git_commit_time , Ptr <git_commit> -> IO (CLong)-#ccall git_commit_time_offset , Ptr <git_commit> -> IO (CInt)-#ccall git_commit_committer , Ptr <git_commit> -> IO (Ptr <git_signature>)-#ccall git_commit_author , Ptr <git_commit> -> IO (Ptr <git_signature>)-#ccall git_commit_tree , Ptr (Ptr <git_tree>) -> Ptr <git_commit> -> IO (CInt)-#ccall git_commit_tree_oid , Ptr <git_commit> -> IO (Ptr <git_oid>)-#ccall git_commit_parentcount , Ptr <git_commit> -> IO (CUInt)-#ccall git_commit_parent , Ptr (Ptr <git_commit>) -> Ptr <git_commit> -> CUInt -> IO (CInt)-#ccall git_commit_parent_oid , Ptr <git_commit> -> CUInt -> IO (Ptr <git_oid>)-#ccall git_commit_create , Ptr <git_oid> -> Ptr <git_repository> -> CString -> Ptr <git_signature> -> Ptr <git_signature> -> CString -> CString -> Ptr <git_tree> -> CInt -> Ptr (Ptr <git_commit>) -> IO (CInt)
− src/Bindings/Libgit2/Commit.hsc.helper.c
@@ -1,6 +0,0 @@-#include <bindings.cmacros.h>-#include <git2.h>--BC_INLINE3(git_commit_lookup, git_commit * *, git_repository *, const git_oid *, int)-BC_INLINE4(git_commit_lookup_prefix, git_commit * *, git_repository *, const git_oid *, unsigned, int)-BC_INLINE1VOID(git_commit_free, git_commit *)
− src/Bindings/Libgit2/Common.hsc
@@ -1,20 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Common where-#strict_import--{- typedef struct {- char * * strings; size_t count;- } git_strarray; -}-#starttype git_strarray-#field strings , Ptr (CString)-#field count , CSize-#stoptype-#ccall git_strarray_free , Ptr <git_strarray> -> IO ()-#ccall git_strarray_copy , Ptr <git_strarray> -> Ptr <git_strarray> -> IO (CInt)-#ccall git_libgit2_version , Ptr CInt -> Ptr CInt -> Ptr CInt -> IO ()--{- BEGIN MANUAL ENTRY -}-#cinline GIT_PATH_LIST_SEPARATOR , CChar-#num GIT_PATH_MAX-{- END MANUAL ENTRY -}
− src/Bindings/Libgit2/Common.hsc.helper.c
@@ -1,4 +0,0 @@-#include <bindings.cmacros.h>-#include <git2.h>--BC_INLINE_(GIT_PATH_LIST_SEPARATOR, char)
− src/Bindings/Libgit2/Config.hsc
@@ -1,83 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Config where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-{- struct git_config_file {- struct git_config * cfg;- int (* open)(struct git_config_file *);- int (* get)(struct git_config_file *,- const char * key,- const char * * value);- int (* get_multivar)(struct git_config_file *,- const char * key,- const char * regexp,- int (* fn)(const char *, void *),- void * data);- int (* set)(struct git_config_file *,- const char * key,- const char * value);- int (* set_multivar)(git_config_file * cfg,- const char * name,- const char * regexp,- const char * value);- int (* del)(struct git_config_file *, const char * key);- int (* foreach)(struct git_config_file *,- int (* fn)(const char *, const char *, void *),- void * data);- void (* free)(struct git_config_file *);-}; -}-#starttype git_config_file-#field cfg , Ptr <git_config>-#field open , FunPtr (Ptr <git_config_file> -> CInt)-#field get , FunPtr (Ptr <git_config_file> -> CString -> Ptr (CString) -> CInt)-#field get_multivar , FunPtr (Ptr <git_config_file> -> CString -> CString -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> CInt)-#field set , FunPtr (Ptr <git_config_file> -> CString -> CString -> CInt)-#field set_multivar , FunPtr (Ptr <git_config_file> -> CString -> CString -> CString -> CInt)-#field del , FunPtr (Ptr <git_config_file> -> CString -> CInt)-#field foreach , FunPtr (Ptr <git_config_file> -> FunPtr (CString -> CString -> Ptr () -> CInt) -> Ptr () -> CInt)-#field free , FunPtr (Ptr <git_config_file>)-#stoptype-{- typedef enum {- GIT_CVAR_FALSE = 0,- GIT_CVAR_TRUE = 1,- GIT_CVAR_INT32,- GIT_CVAR_STRING- } git_cvar_t; -}-#integral_t git_cvar_t-#num GIT_CVAR_FALSE-#num GIT_CVAR_TRUE-#num GIT_CVAR_INT32-#num GIT_CVAR_STRING-{- typedef struct {- git_cvar_t cvar_type; const char * str_match; int map_value;- } git_cvar_map; -}-#starttype git_cvar_map-#field cvar_type , <git_cvar_t>-#field str_match , CString-#field map_value , CInt-#stoptype-#ccall git_config_find_global , CString -> CSize -> IO (CInt)-#ccall git_config_find_system , CString -> CSize -> IO (CInt)-#ccall git_config_open_global , Ptr (Ptr <git_config>) -> IO (CInt)-#ccall git_config_file__ondisk , Ptr (Ptr <git_config_file>) -> CString -> IO (CInt)-#ccall git_config_new , Ptr (Ptr <git_config>) -> IO (CInt)-#ccall git_config_add_file , Ptr <git_config> -> Ptr <git_config_file> -> CInt -> IO (CInt)-#ccall git_config_add_file_ondisk , Ptr <git_config> -> CString -> CInt -> IO (CInt)-#ccall git_config_open_ondisk , Ptr (Ptr <git_config>) -> CString -> IO (CInt)-#ccall git_config_free , Ptr <git_config> -> IO ()-#ccall git_config_get_int32 , Ptr CInt -> Ptr <git_config> -> CString -> IO (CInt)-#ccall git_config_get_int64 , Ptr CLong -> Ptr <git_config> -> CString -> IO (CInt)-#ccall git_config_get_bool , Ptr CInt -> Ptr <git_config> -> CString -> IO (CInt)-#ccall git_config_get_string , Ptr (CString) -> Ptr <git_config> -> CString -> IO (CInt)-#ccall git_config_get_multivar , Ptr <git_config> -> CString -> CString -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)-#ccall git_config_set_int32 , Ptr <git_config> -> CString -> CInt -> IO (CInt)-#ccall git_config_set_int64 , Ptr <git_config> -> CString -> CLong -> IO (CInt)-#ccall git_config_set_bool , Ptr <git_config> -> CString -> CInt -> IO (CInt)-#ccall git_config_set_string , Ptr <git_config> -> CString -> CString -> IO (CInt)-#ccall git_config_set_multivar , Ptr <git_config> -> CString -> CString -> CString -> IO (CInt)-#ccall git_config_delete , Ptr <git_config> -> CString -> IO (CInt)-#ccall git_config_foreach , Ptr <git_config> -> FunPtr (CString -> CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)-#ccall git_config_get_mapped , Ptr CInt -> Ptr <git_config> -> CString -> Ptr <git_cvar_map> -> CSize -> IO (CInt)
− src/Bindings/Libgit2/Diff.hsc
@@ -1,169 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Diff where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-import Bindings.Libgit2.Tree-import Bindings.Libgit2.Refs-{- enum {- GIT_DIFF_NORMAL = 0,- GIT_DIFF_REVERSE = 1 << 0,- GIT_DIFF_FORCE_TEXT = 1 << 1,- GIT_DIFF_IGNORE_WHITESPACE = 1 << 2,- GIT_DIFF_IGNORE_WHITESPACE_CHANGE = 1 << 3,- GIT_DIFF_IGNORE_WHITESPACE_EOL = 1 << 4,- GIT_DIFF_IGNORE_SUBMODULES = 1 << 5,- GIT_DIFF_PATIENCE = 1 << 6,- GIT_DIFF_INCLUDE_IGNORED = 1 << 7,- GIT_DIFF_INCLUDE_UNTRACKED = 1 << 8,- GIT_DIFF_INCLUDE_UNMODIFIED = 1 << 9,- GIT_DIFF_RECURSE_UNTRACKED_DIRS = 1 << 10-}; -}-#num GIT_DIFF_NORMAL-#num GIT_DIFF_REVERSE-#num GIT_DIFF_FORCE_TEXT-#num GIT_DIFF_IGNORE_WHITESPACE-#num GIT_DIFF_IGNORE_WHITESPACE_CHANGE-#num GIT_DIFF_IGNORE_WHITESPACE_EOL-#num GIT_DIFF_IGNORE_SUBMODULES-#num GIT_DIFF_PATIENCE-#num GIT_DIFF_INCLUDE_IGNORED-#num GIT_DIFF_INCLUDE_UNTRACKED-#num GIT_DIFF_INCLUDE_UNMODIFIED-#num GIT_DIFF_RECURSE_UNTRACKED_DIRS-{- typedef struct {- uint32_t flags;- uint16_t context_lines;- uint16_t interhunk_lines;- char * old_prefix;- char * new_prefix;- git_strarray pathspec;- } git_diff_options; -}-#starttype git_diff_options-#field flags , CUInt-#field context_lines , CUShort-#field interhunk_lines , CUShort-#field old_prefix , CString-#field new_prefix , CString-#field pathspec , <git_strarray>-#stoptype-{- typedef struct git_diff_list git_diff_list; -}-#opaque_t git_diff_list-{- enum {- GIT_DIFF_FILE_VALID_OID = 1 << 0,- GIT_DIFF_FILE_FREE_PATH = 1 << 1,- GIT_DIFF_FILE_BINARY = 1 << 2,- GIT_DIFF_FILE_NOT_BINARY = 1 << 3,- GIT_DIFF_FILE_FREE_DATA = 1 << 4,- GIT_DIFF_FILE_UNMAP_DATA = 1 << 5-}; -}-#num GIT_DIFF_FILE_VALID_OID-#num GIT_DIFF_FILE_FREE_PATH-#num GIT_DIFF_FILE_BINARY-#num GIT_DIFF_FILE_NOT_BINARY-#num GIT_DIFF_FILE_FREE_DATA-#num GIT_DIFF_FILE_UNMAP_DATA-{- typedef enum {- GIT_DELTA_UNMODIFIED = 0,- GIT_DELTA_ADDED = 1,- GIT_DELTA_DELETED = 2,- GIT_DELTA_MODIFIED = 3,- GIT_DELTA_RENAMED = 4,- GIT_DELTA_COPIED = 5,- GIT_DELTA_IGNORED = 6,- GIT_DELTA_UNTRACKED = 7- } git_delta_t; -}-#integral_t git_delta_t-#num GIT_DELTA_UNMODIFIED-#num GIT_DELTA_ADDED-#num GIT_DELTA_DELETED-#num GIT_DELTA_MODIFIED-#num GIT_DELTA_RENAMED-#num GIT_DELTA_COPIED-#num GIT_DELTA_IGNORED-#num GIT_DELTA_UNTRACKED-{- typedef struct {- git_oid oid;- char * path;- uint16_t mode;- git_off_t size;- unsigned int flags;- } git_diff_file; -}-#starttype git_diff_file-#field oid , <git_oid>-#field path , CString-#field mode , CUShort-#field size , CLong-#field flags , CUInt-#stoptype-{- typedef struct {- git_diff_file old_file;- git_diff_file new_file;- git_delta_t status;- unsigned int similarity;- int binary;- } git_diff_delta; -}-#starttype git_diff_delta-#field old_file , <git_diff_file>-#field new_file , <git_diff_file>-#field status , <git_delta_t>-#field similarity , CUInt-#field binary , CInt-#stoptype-{- typedef int (* git_diff_file_fn)(void * cb_data,- git_diff_delta * delta,- float progress); -}-#synonym_t git_diff_file_fn , CInt-{- typedef struct {- int old_start; int old_lines; int new_start; int new_lines;- } git_diff_range; -}-#starttype git_diff_range-#field old_start , CInt-#field old_lines , CInt-#field new_start , CInt-#field new_lines , CInt-#stoptype-{- typedef int (* git_diff_hunk_fn)(void * cb_data,- git_diff_delta * delta,- git_diff_range * range,- const char * header,- size_t header_len); -}-#synonym_t git_diff_hunk_fn , CInt-{- enum {- GIT_DIFF_LINE_CONTEXT = ' ',- GIT_DIFF_LINE_ADDITION = '+',- GIT_DIFF_LINE_DELETION = '-',- GIT_DIFF_LINE_ADD_EOFNL = '\n',- GIT_DIFF_LINE_DEL_EOFNL = '\0',- GIT_DIFF_LINE_FILE_HDR = 'F',- GIT_DIFF_LINE_HUNK_HDR = 'H',- GIT_DIFF_LINE_BINARY = 'B'-}; -}-#num GIT_DIFF_LINE_CONTEXT-#num GIT_DIFF_LINE_ADDITION-#num GIT_DIFF_LINE_DELETION-#num GIT_DIFF_LINE_ADD_EOFNL-#num GIT_DIFF_LINE_DEL_EOFNL-#num GIT_DIFF_LINE_FILE_HDR-#num GIT_DIFF_LINE_HUNK_HDR-#num GIT_DIFF_LINE_BINARY-{- typedef int (* git_diff_data_fn)(void * cb_data,- git_diff_delta * delta,- git_diff_range * range,- char line_origin,- const char * content,- size_t content_len); -}-#synonym_t git_diff_data_fn , CInt-#ccall git_diff_list_free , Ptr <git_diff_list> -> IO ()-#ccall git_diff_tree_to_tree , Ptr <git_repository> -> Ptr <git_diff_options> -> Ptr <git_tree> -> Ptr <git_tree> -> Ptr (Ptr <git_diff_list>) -> IO (CInt)-#ccall git_diff_index_to_tree , Ptr <git_repository> -> Ptr <git_diff_options> -> Ptr <git_tree> -> Ptr (Ptr <git_diff_list>) -> IO (CInt)-#ccall git_diff_workdir_to_index , Ptr <git_repository> -> Ptr <git_diff_options> -> Ptr (Ptr <git_diff_list>) -> IO (CInt)-#ccall git_diff_workdir_to_tree , Ptr <git_repository> -> Ptr <git_diff_options> -> Ptr <git_tree> -> Ptr (Ptr <git_diff_list>) -> IO (CInt)-#ccall git_diff_merge , Ptr <git_diff_list> -> Ptr <git_diff_list> -> IO (CInt)-#ccall git_diff_foreach , Ptr <git_diff_list> -> Ptr () -> CInt -> CInt -> CInt -> IO (CInt)-#ccall git_diff_print_compact , Ptr <git_diff_list> -> Ptr () -> CInt -> IO (CInt)-#ccall git_diff_print_patch , Ptr <git_diff_list> -> Ptr () -> CInt -> IO (CInt)-#ccall git_diff_blobs , Ptr <git_blob> -> Ptr <git_blob> -> Ptr <git_diff_options> -> Ptr () -> CInt -> CInt -> CInt -> IO (CInt)
− src/Bindings/Libgit2/Errors.hsc
@@ -1,66 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Errors where-#strict_import--import Bindings.Libgit2.Common-{- enum {- GIT_OK = 0,- GIT_ERROR = -1,- GIT_ENOTFOUND = -3,- GIT_EEXISTS = -4,- GIT_EAMBIGUOUS = -5,- GIT_EBUFS = -6,- GIT_PASSTHROUGH = -30,- GIT_REVWALKOVER = -31-}; -}-#num GIT_OK-#num GIT_ERROR-#num GIT_ENOTFOUND-#num GIT_EEXISTS-#num GIT_EAMBIGUOUS-#num GIT_EBUFS-#num GIT_PASSTHROUGH-#num GIT_REVWALKOVER-{- typedef struct {- char * message; int klass;- } git_error; -}-#starttype git_error-#field message , CString-#field klass , CInt-#stoptype-{- typedef enum {- GITERR_NOMEMORY,- GITERR_OS,- GITERR_INVALID,- GITERR_REFERENCE,- GITERR_ZLIB,- GITERR_REPOSITORY,- GITERR_CONFIG,- GITERR_REGEX,- GITERR_ODB,- GITERR_INDEX,- GITERR_OBJECT,- GITERR_NET,- GITERR_TAG,- GITERR_TREE,- GITERR_INDEXER- } git_error_t; -}-#integral_t git_error_t-#num GITERR_NOMEMORY-#num GITERR_OS-#num GITERR_INVALID-#num GITERR_REFERENCE-#num GITERR_ZLIB-#num GITERR_REPOSITORY-#num GITERR_CONFIG-#num GITERR_REGEX-#num GITERR_ODB-#num GITERR_INDEX-#num GITERR_OBJECT-#num GITERR_NET-#num GITERR_TAG-#num GITERR_TREE-#num GITERR_INDEXER-#ccall giterr_last , IO (Ptr <git_error>)-#ccall giterr_clear , IO ()
− src/Bindings/Libgit2/Index.hsc
@@ -1,70 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Index where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-{- typedef struct {- git_time_t seconds; unsigned int nanoseconds;- } git_index_time; -}-#starttype git_index_time-#field seconds , CLong-#field nanoseconds , CUInt-#stoptype-{- typedef struct git_index_entry {- git_index_time ctime;- git_index_time mtime;- unsigned int dev;- unsigned int ino;- unsigned int mode;- unsigned int uid;- unsigned int gid;- git_off_t file_size;- git_oid oid;- unsigned short flags;- unsigned short flags_extended;- char * path;- } git_index_entry; -}-#starttype git_index_entry-#field ctime , <git_index_time>-#field mtime , <git_index_time>-#field dev , CUInt-#field ino , CUInt-#field mode , CUInt-#field uid , CUInt-#field gid , CUInt-#field file_size , CLong-#field oid , <git_oid>-#field flags , CUShort-#field flags_extended , CUShort-#field path , CString-#stoptype-{- typedef struct git_index_entry_unmerged {- unsigned int mode[3]; git_oid oid[3]; char * path;- } git_index_entry_unmerged; -}-#starttype git_index_entry_unmerged-#array_field mode , CUInt-#array_field oid , <git_oid>-#field path , CString-#stoptype-#ccall git_index_open , Ptr (Ptr <git_index>) -> CString -> IO (CInt)-#ccall git_index_clear , Ptr <git_index> -> IO ()-#ccall git_index_free , Ptr <git_index> -> IO ()-#ccall git_index_read , Ptr <git_index> -> IO (CInt)-#ccall git_index_write , Ptr <git_index> -> IO (CInt)-#ccall git_index_find , Ptr <git_index> -> CString -> IO (CInt)-#ccall git_index_uniq , Ptr <git_index> -> IO ()-#ccall git_index_add , Ptr <git_index> -> CString -> CInt -> IO (CInt)-#ccall git_index_add2 , Ptr <git_index> -> Ptr <git_index_entry> -> IO (CInt)-#ccall git_index_append , Ptr <git_index> -> CString -> CInt -> IO (CInt)-#ccall git_index_append2 , Ptr <git_index> -> Ptr <git_index_entry> -> IO (CInt)-#ccall git_index_remove , Ptr <git_index> -> CInt -> IO (CInt)-#ccall git_index_get , Ptr <git_index> -> CUInt -> IO (Ptr <git_index_entry>)-#ccall git_index_entrycount , Ptr <git_index> -> IO (CUInt)-#ccall git_index_entrycount_unmerged , Ptr <git_index> -> IO (CUInt)-#ccall git_index_get_unmerged_bypath , Ptr <git_index> -> CString -> IO (Ptr <git_index_entry_unmerged>)-#ccall git_index_get_unmerged_byindex , Ptr <git_index> -> CUInt -> IO (Ptr <git_index_entry_unmerged>)-#ccall git_index_entry_stage , Ptr <git_index_entry> -> IO (CInt)-#ccall git_index_read_tree , Ptr <git_index> -> Ptr <git_tree> -> IO (CInt)
− src/Bindings/Libgit2/Indexer.hsc
@@ -1,28 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Indexer where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Oid-{- typedef struct git_indexer_stats {- unsigned int total; unsigned int processed;- } git_indexer_stats; -}-#starttype git_indexer_stats-#field total , CUInt-#field processed , CUInt-#stoptype-{- typedef struct git_indexer git_indexer; -}-#opaque_t git_indexer-{- typedef struct git_indexer_stream git_indexer_stream; -}-#opaque_t git_indexer_stream-#ccall git_indexer_stream_new , Ptr (Ptr <git_indexer_stream>) -> CString -> IO (CInt)-#ccall git_indexer_stream_add , Ptr <git_indexer_stream> -> Ptr () -> CSize -> Ptr <git_indexer_stats> -> IO (CInt)-#ccall git_indexer_stream_finalize , Ptr <git_indexer_stream> -> Ptr <git_indexer_stats> -> IO (CInt)-#ccall git_indexer_stream_hash , Ptr <git_indexer_stream> -> IO (Ptr <git_oid>)-#ccall git_indexer_stream_free , Ptr <git_indexer_stream> -> IO ()-#ccall git_indexer_new , Ptr (Ptr <git_indexer>) -> CString -> IO (CInt)-#ccall git_indexer_run , Ptr <git_indexer> -> Ptr <git_indexer_stats> -> IO (CInt)-#ccall git_indexer_write , Ptr <git_indexer> -> IO (CInt)-#ccall git_indexer_hash , Ptr <git_indexer> -> IO (Ptr <git_oid>)-#ccall git_indexer_free , Ptr <git_indexer> -> IO ()
− src/Bindings/Libgit2/Merge.hsc
@@ -1,9 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Merge where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-#ccall git_merge_base , Ptr <git_oid> -> Ptr <git_repository> -> Ptr <git_oid> -> Ptr <git_oid> -> IO (CInt)
− src/Bindings/Libgit2/Net.hsc
@@ -1,19 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Net where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Oid-import Bindings.Libgit2.Types-{- struct git_remote_head {- int local : 1; git_oid oid; git_oid loid; char * name;-}; -}-#starttype git_remote_head--- #field local , CInt-#field oid , <git_oid>-#field loid , <git_oid>-#field name , CString-#stoptype-{- typedef int (* git_headlist_cb)(git_remote_head *, void *); -}-#synonym_t git_headlist_cb , CInt
− src/Bindings/Libgit2/Notes.hsc
@@ -1,22 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Notes where-#strict_import--import Bindings.Libgit2.Oid-import Bindings.Libgit2.Types-#ccall git_note_read , Ptr (Ptr <git_note>) -> Ptr <git_repository> -> CString -> Ptr <git_oid> -> IO (CInt)-#ccall git_note_message , Ptr <git_note> -> IO (CString)-#ccall git_note_oid , Ptr <git_note> -> IO (Ptr <git_oid>)-#ccall git_note_create , Ptr <git_oid> -> Ptr <git_repository> -> Ptr <git_signature> -> Ptr <git_signature> -> CString -> Ptr <git_oid> -> CString -> IO (CInt)-#ccall git_note_remove , Ptr <git_repository> -> CString -> Ptr <git_signature> -> Ptr <git_signature> -> Ptr <git_oid> -> IO (CInt)-#ccall git_note_free , Ptr <git_note> -> IO ()-#ccall git_note_default_ref , Ptr (CString) -> Ptr <git_repository> -> IO (CInt)-{- typedef struct {- git_oid blob_oid; git_oid annotated_object_oid;- } git_note_data; -}-#starttype git_note_data-#field blob_oid , <git_oid>-#field annotated_object_oid , <git_oid>-#stoptype-#ccall git_note_foreach , Ptr <git_repository> -> CString -> FunPtr (Ptr <git_note_data> -> Ptr () -> CInt) -> Ptr () -> IO (CInt)
− src/Bindings/Libgit2/Object.hsc
@@ -1,18 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Object where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-#ccall git_object_lookup , Ptr (Ptr <git_object>) -> Ptr <git_repository> -> Ptr <git_oid> -> <git_otype> -> IO (CInt)-#ccall git_object_lookup_prefix , Ptr (Ptr <git_object>) -> Ptr <git_repository> -> Ptr <git_oid> -> CUInt -> <git_otype> -> IO (CInt)-#ccall git_object_id , Ptr <git_object> -> IO (Ptr <git_oid>)-#ccall git_object_type , Ptr <git_object> -> IO (<git_otype>)-#ccall git_object_owner , Ptr <git_object> -> IO (Ptr <git_repository>)-#ccall git_object_free , Ptr <git_object> -> IO ()-#ccall git_object_type2string , <git_otype> -> IO (CString)-#ccall git_object_string2type , CString -> IO (<git_otype>)-#ccall git_object_typeisloose , <git_otype> -> IO (CInt)-#ccall git_object__size , <git_otype> -> IO (CSize)
− src/Bindings/Libgit2/Odb.hsc
@@ -1,28 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Odb where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-import Bindings.Libgit2.OdbBackend-#ccall git_odb_new , Ptr (Ptr <git_odb>) -> IO (CInt)-#ccall git_odb_open , Ptr (Ptr <git_odb>) -> CString -> IO (CInt)-#ccall git_odb_add_backend , Ptr <git_odb> -> Ptr <git_odb_backend> -> CInt -> IO (CInt)-#ccall git_odb_add_alternate , Ptr <git_odb> -> Ptr <git_odb_backend> -> CInt -> IO (CInt)-#ccall git_odb_free , Ptr <git_odb> -> IO ()-#ccall git_odb_read , Ptr (Ptr <git_odb_object>) -> Ptr <git_odb> -> Ptr <git_oid> -> IO (CInt)-#ccall git_odb_read_prefix , Ptr (Ptr <git_odb_object>) -> Ptr <git_odb> -> Ptr <git_oid> -> CUInt -> IO (CInt)-#ccall git_odb_read_header , Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb> -> Ptr <git_oid> -> IO (CInt)-#ccall git_odb_exists , Ptr <git_odb> -> Ptr <git_oid> -> IO (CInt)-#ccall git_odb_write , Ptr <git_oid> -> Ptr <git_odb> -> Ptr () -> CSize -> <git_otype> -> IO (CInt)-#ccall git_odb_open_wstream , Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb> -> CSize -> <git_otype> -> IO (CInt)-#ccall git_odb_open_rstream , Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb> -> Ptr <git_oid> -> IO (CInt)-#ccall git_odb_hash , Ptr <git_oid> -> Ptr () -> CSize -> <git_otype> -> IO (CInt)-#ccall git_odb_hashfile , Ptr <git_oid> -> CString -> <git_otype> -> IO (CInt)-#ccall git_odb_object_free , Ptr <git_odb_object> -> IO ()-#ccall git_odb_object_id , Ptr <git_odb_object> -> IO (Ptr <git_oid>)-#ccall git_odb_object_data , Ptr <git_odb_object> -> IO (Ptr ())-#ccall git_odb_object_size , Ptr <git_odb_object> -> IO (CSize)-#ccall git_odb_object_type , Ptr <git_odb_object> -> IO (<git_otype>)
− src/Bindings/Libgit2/OdbBackend.hsc
@@ -1,83 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.OdbBackend where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-{- struct git_odb_backend {- git_odb * odb;- int (* read)(void * *,- size_t *,- git_otype *,- struct git_odb_backend *,- const git_oid *);- int (* read_prefix)(git_oid *,- void * *,- size_t *,- git_otype *,- struct git_odb_backend *,- const git_oid *,- unsigned int);- int (* read_header)(size_t *,- git_otype *,- struct git_odb_backend *,- const git_oid *);- int (* write)(git_oid *,- struct git_odb_backend *,- const void *,- size_t,- git_otype);- int (* writestream)(struct git_odb_stream * *,- struct git_odb_backend *,- size_t,- git_otype);- int (* readstream)(struct git_odb_stream * *,- struct git_odb_backend *,- const git_oid *);- int (* exists)(struct git_odb_backend *, const git_oid *);- void (* free)(struct git_odb_backend *);-}; -}-#starttype git_odb_backend-#field odb , Ptr <git_odb>-#field read , FunPtr (Ptr (Ptr ()) -> Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)-#field read_prefix , FunPtr (Ptr <git_oid> -> Ptr (Ptr ()) -> Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CUInt -> CInt)-#field read_header , FunPtr (Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)-#field write , FunPtr (Ptr <git_oid> -> Ptr <git_odb_backend> -> Ptr () -> CSize -> <git_otype> -> CInt)-#field writestream , FunPtr (Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb_backend> -> CSize -> <git_otype> -> CInt)-#field readstream , FunPtr (Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)-#field exists , FunPtr (Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)-#field free , FunPtr (Ptr <git_odb_backend>)-#stoptype-{- enum {- GIT_STREAM_RDONLY = 1 << 1,- GIT_STREAM_WRONLY = 1 << 2,- GIT_STREAM_RW = GIT_STREAM_RDONLY | GIT_STREAM_WRONLY-}; -}-#num GIT_STREAM_RDONLY-#num GIT_STREAM_WRONLY-#num GIT_STREAM_RW-{- struct git_odb_stream {- struct git_odb_backend * backend;- int mode;- int (* read)(struct git_odb_stream * stream,- char * buffer,- size_t len);- int (* write)(struct git_odb_stream * stream,- const char * buffer,- size_t len);- int (* finalize_write)(git_oid * oid_p,- struct git_odb_stream * stream);- void (* free)(struct git_odb_stream * stream);-}; -}-#starttype git_odb_stream-#field backend , Ptr <git_odb_backend>-#field mode , CInt-#field read , FunPtr (Ptr <git_odb_stream> -> CString -> CSize -> CInt)-#field write , FunPtr (Ptr <git_odb_stream> -> CString -> CSize -> CInt)-#field finalize_write , FunPtr (Ptr <git_oid> -> Ptr <git_odb_stream> -> CInt)-#field free , FunPtr (Ptr <git_odb_stream>)-#stoptype-#ccall git_odb_backend_pack , Ptr (Ptr <git_odb_backend>) -> CString -> IO (CInt)-#ccall git_odb_backend_loose , Ptr (Ptr <git_odb_backend>) -> CString -> CInt -> CInt -> IO (CInt)
− src/Bindings/Libgit2/Oid.hsc
@@ -1,33 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Oid where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-#num GIT_OID_RAWSZ-#num GIT_OID_HEXSZ-#num GIT_OID_MINPREFIXLEN-{- struct _git_oid {- unsigned char id[20];-}; -}-#starttype git_oid-#array_field id , CUChar-#stoptype-#ccall git_oid_fromstr , Ptr <git_oid> -> CString -> IO (CInt)-#ccall git_oid_fromstrn , Ptr <git_oid> -> CString -> CSize -> IO (CInt)-#ccall git_oid_fromraw , Ptr <git_oid> -> Ptr CUChar -> IO ()-#ccall git_oid_fmt , CString -> Ptr <git_oid> -> IO ()-#ccall git_oid_pathfmt , CString -> Ptr <git_oid> -> IO ()-#ccall git_oid_allocfmt , Ptr <git_oid> -> IO (CString)-#ccall git_oid_tostr , CString -> CSize -> Ptr <git_oid> -> IO (CString)-#ccall git_oid_cpy , Ptr <git_oid> -> Ptr <git_oid> -> IO ()-#ccall git_oid_cmp , Ptr <git_oid> -> Ptr <git_oid> -> IO (CInt)-#ccall git_oid_ncmp , Ptr <git_oid> -> Ptr <git_oid> -> CUInt -> IO (CInt)-#ccall git_oid_streq , Ptr <git_oid> -> CString -> IO (CInt)-#ccall git_oid_iszero , Ptr <git_oid> -> IO (CInt)-{- typedef struct git_oid_shorten git_oid_shorten; -}-#opaque_t git_oid_shorten-#ccall git_oid_shorten_new , CSize -> IO (Ptr <git_oid_shorten>)-#ccall git_oid_shorten_add , Ptr <git_oid_shorten> -> CString -> IO (CInt)-#ccall git_oid_shorten_free , Ptr <git_oid_shorten> -> IO ()
− src/Bindings/Libgit2/Reflog.hsc
@@ -1,19 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Reflog where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-#ccall git_reflog_read , Ptr (Ptr <git_reflog>) -> Ptr <git_reference> -> IO (CInt)-#ccall git_reflog_write , Ptr <git_reference> -> Ptr <git_oid> -> Ptr <git_signature> -> CString -> IO (CInt)-#ccall git_reflog_rename , Ptr <git_reference> -> CString -> IO (CInt)-#ccall git_reflog_delete , Ptr <git_reference> -> IO (CInt)-#ccall git_reflog_entrycount , Ptr <git_reflog> -> IO (CUInt)-#ccall git_reflog_entry_byindex , Ptr <git_reflog> -> CUInt -> IO (Ptr <git_reflog_entry>)-#ccall git_reflog_entry_oidold , Ptr <git_reflog_entry> -> IO (Ptr <git_oid>)-#ccall git_reflog_entry_oidnew , Ptr <git_reflog_entry> -> IO (Ptr <git_oid>)-#ccall git_reflog_entry_committer , Ptr <git_reflog_entry> -> IO (Ptr <git_signature>)-#ccall git_reflog_entry_msg , Ptr <git_reflog_entry> -> IO (CString)-#ccall git_reflog_free , Ptr <git_reflog> -> IO ()
− src/Bindings/Libgit2/Refs.hsc
@@ -1,29 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Refs where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-#ccall git_reference_lookup , Ptr (Ptr <git_reference>) -> Ptr <git_repository> -> CString -> IO (CInt)-#ccall git_reference_name_to_oid , Ptr <git_oid> -> Ptr <git_repository> -> CString -> IO (CInt)-#ccall git_reference_create_symbolic , Ptr (Ptr <git_reference>) -> Ptr <git_repository> -> CString -> CString -> CInt -> IO (CInt)-#ccall git_reference_create_oid , Ptr (Ptr <git_reference>) -> Ptr <git_repository> -> CString -> Ptr <git_oid> -> CInt -> IO (CInt)-#ccall git_reference_oid , Ptr <git_reference> -> IO (Ptr <git_oid>)-#ccall git_reference_target , Ptr <git_reference> -> IO (CString)-#ccall git_reference_type , Ptr <git_reference> -> IO (<git_ref_t>)-#ccall git_reference_name , Ptr <git_reference> -> IO (CString)-#ccall git_reference_resolve , Ptr (Ptr <git_reference>) -> Ptr <git_reference> -> IO (CInt)-#ccall git_reference_owner , Ptr <git_reference> -> IO (Ptr <git_repository>)-#ccall git_reference_set_target , Ptr <git_reference> -> CString -> IO (CInt)-#ccall git_reference_set_oid , Ptr <git_reference> -> Ptr <git_oid> -> IO (CInt)-#ccall git_reference_rename , Ptr <git_reference> -> CString -> CInt -> IO (CInt)-#ccall git_reference_delete , Ptr <git_reference> -> IO (CInt)-#ccall git_reference_packall , Ptr <git_repository> -> IO (CInt)-#ccall git_reference_list , Ptr <git_strarray> -> Ptr <git_repository> -> CUInt -> IO (CInt)-#ccall git_reference_foreach , Ptr <git_repository> -> CUInt -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)-#ccall git_reference_is_packed , Ptr <git_reference> -> IO (CInt)-#ccall git_reference_reload , Ptr <git_reference> -> IO (CInt)-#ccall git_reference_free , Ptr <git_reference> -> IO ()-#ccall git_reference_cmp , Ptr <git_reference> -> Ptr <git_reference> -> IO (CInt)
− src/Bindings/Libgit2/Refspec.hsc
@@ -1,11 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Refspec where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-#ccall git_refspec_src , Ptr <git_refspec> -> IO (CString)-#ccall git_refspec_dst , Ptr <git_refspec> -> IO (CString)-#ccall git_refspec_src_matches , Ptr <git_refspec> -> CString -> IO (CInt)-#ccall git_refspec_transform , CString -> CSize -> Ptr <git_refspec> -> CString -> IO (CInt)
− src/Bindings/Libgit2/Remote.hsc
@@ -1,32 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Remote where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Repository-import Bindings.Libgit2.Refspec-import Bindings.Libgit2.Net-import Bindings.Libgit2.Indexer-import Bindings.Libgit2.Oid-import Bindings.Libgit2.Types-#ccall git_remote_new , Ptr (Ptr <git_remote>) -> Ptr <git_repository> -> CString -> CString -> CString -> IO (CInt)-#ccall git_remote_load , Ptr (Ptr <git_remote>) -> Ptr <git_repository> -> CString -> IO (CInt)-#ccall git_remote_save , Ptr <git_remote> -> IO (CInt)-#ccall git_remote_name , Ptr <git_remote> -> IO (CString)-#ccall git_remote_url , Ptr <git_remote> -> IO (CString)-#ccall git_remote_set_fetchspec , Ptr <git_remote> -> CString -> IO (CInt)-#ccall git_remote_fetchspec , Ptr <git_remote> -> IO (Ptr <git_refspec>)-#ccall git_remote_set_pushspec , Ptr <git_remote> -> CString -> IO (CInt)-#ccall git_remote_pushspec , Ptr <git_remote> -> IO (Ptr <git_refspec>)-#ccall git_remote_connect , Ptr <git_remote> -> CInt -> IO (CInt)-#ccall git_remote_ls , Ptr <git_remote> -> CInt -> Ptr () -> IO (CInt)-#ccall git_remote_download , Ptr <git_remote> -> Ptr CLong -> Ptr <git_indexer_stats> -> IO (CInt)-#ccall git_remote_connected , Ptr <git_remote> -> IO (CInt)-#ccall git_remote_disconnect , Ptr <git_remote> -> IO ()-#ccall git_remote_free , Ptr <git_remote> -> IO ()-#ccall git_remote_update_tips , Ptr <git_remote> -> FunPtr (CString -> Ptr <git_oid> -> Ptr <git_oid> -> CInt) -> IO (CInt)-#ccall git_remote_valid_url , CString -> IO (CInt)-#ccall git_remote_supported_url , CString -> IO (CInt)-#ccall git_remote_list , Ptr <git_strarray> -> Ptr <git_repository> -> IO (CInt)-#ccall git_remote_add , Ptr (Ptr <git_remote>) -> Ptr <git_repository> -> CString -> CString -> IO (CInt)
− src/Bindings/Libgit2/Repository.hsc
@@ -1,33 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Repository where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-#ccall git_repository_open , Ptr (Ptr <git_repository>) -> CString -> IO (CInt)-#ccall git_repository_discover , CString -> CSize -> CString -> CInt -> CString -> IO (CInt)-{- enum {- GIT_REPOSITORY_OPEN_NO_SEARCH = 1 << 0,- GIT_REPOSITORY_OPEN_CROSS_FS = 1 << 1-}; -}-#num GIT_REPOSITORY_OPEN_NO_SEARCH-#num GIT_REPOSITORY_OPEN_CROSS_FS-#ccall git_repository_open_ext , Ptr (Ptr <git_repository>) -> CString -> CUInt -> CString -> IO (CInt)-#ccall git_repository_free , Ptr <git_repository> -> IO ()-#ccall git_repository_init , Ptr (Ptr <git_repository>) -> CString -> CUInt -> IO (CInt)-#ccall git_repository_head , Ptr (Ptr <git_reference>) -> Ptr <git_repository> -> IO (CInt)-#ccall git_repository_head_detached , Ptr <git_repository> -> IO (CInt)-#ccall git_repository_head_orphan , Ptr <git_repository> -> IO (CInt)-#ccall git_repository_is_empty , Ptr <git_repository> -> IO (CInt)-#ccall git_repository_path , Ptr <git_repository> -> IO (CString)-#ccall git_repository_workdir , Ptr <git_repository> -> IO (CString)-#ccall git_repository_set_workdir , Ptr <git_repository> -> CString -> IO (CInt)-#ccall git_repository_is_bare , Ptr <git_repository> -> IO (CInt)-#ccall git_repository_config , Ptr (Ptr <git_config>) -> Ptr <git_repository> -> IO (CInt)-#ccall git_repository_set_config , Ptr <git_repository> -> Ptr <git_config> -> IO ()-#ccall git_repository_odb , Ptr (Ptr <git_odb>) -> Ptr <git_repository> -> IO (CInt)-#ccall git_repository_set_odb , Ptr <git_repository> -> Ptr <git_odb> -> IO ()-#ccall git_repository_index , Ptr (Ptr <git_index>) -> Ptr <git_repository> -> IO (CInt)-#ccall git_repository_set_index , Ptr <git_repository> -> Ptr <git_index> -> IO ()
− src/Bindings/Libgit2/Revwalk.hsc
@@ -1,22 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Revwalk where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-#ccall git_revwalk_new , Ptr (Ptr <git_revwalk>) -> Ptr <git_repository> -> IO (CInt)-#ccall git_revwalk_reset , Ptr <git_revwalk> -> IO ()-#ccall git_revwalk_push , Ptr <git_revwalk> -> Ptr <git_oid> -> IO (CInt)-#ccall git_revwalk_push_glob , Ptr <git_revwalk> -> CString -> IO (CInt)-#ccall git_revwalk_push_head , Ptr <git_revwalk> -> IO (CInt)-#ccall git_revwalk_hide , Ptr <git_revwalk> -> Ptr <git_oid> -> IO (CInt)-#ccall git_revwalk_hide_glob , Ptr <git_revwalk> -> CString -> IO (CInt)-#ccall git_revwalk_hide_head , Ptr <git_revwalk> -> IO (CInt)-#ccall git_revwalk_push_ref , Ptr <git_revwalk> -> CString -> IO (CInt)-#ccall git_revwalk_hide_ref , Ptr <git_revwalk> -> CString -> IO (CInt)-#ccall git_revwalk_next , Ptr <git_oid> -> Ptr <git_revwalk> -> IO (CInt)-#ccall git_revwalk_sorting , Ptr <git_revwalk> -> CUInt -> IO ()-#ccall git_revwalk_free , Ptr <git_revwalk> -> IO ()-#ccall git_revwalk_repository , Ptr <git_revwalk> -> IO (Ptr <git_repository>)
− src/Bindings/Libgit2/Signature.hsc
@@ -1,11 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Signature where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-#ccall git_signature_new , Ptr (Ptr <git_signature>) -> CString -> CString -> CLong -> CInt -> IO (CInt)-#ccall git_signature_now , Ptr (Ptr <git_signature>) -> CString -> CString -> IO (CInt)-#ccall git_signature_dup , Ptr <git_signature> -> IO (Ptr <git_signature>)-#ccall git_signature_free , Ptr <git_signature> -> IO ()
− src/Bindings/Libgit2/Status.hsc
@@ -1,60 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Status where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-{- enum {- GIT_STATUS_CURRENT = 0,- GIT_STATUS_INDEX_NEW = 1 << 0,- GIT_STATUS_INDEX_MODIFIED = 1 << 1,- GIT_STATUS_INDEX_DELETED = 1 << 2,- GIT_STATUS_WT_NEW = 1 << 3,- GIT_STATUS_WT_MODIFIED = 1 << 4,- GIT_STATUS_WT_DELETED = 1 << 5,- GIT_STATUS_IGNORED = 1 << 6-}; -}-#num GIT_STATUS_CURRENT-#num GIT_STATUS_INDEX_NEW-#num GIT_STATUS_INDEX_MODIFIED-#num GIT_STATUS_INDEX_DELETED-#num GIT_STATUS_WT_NEW-#num GIT_STATUS_WT_MODIFIED-#num GIT_STATUS_WT_DELETED-#num GIT_STATUS_IGNORED-#ccall git_status_foreach , Ptr <git_repository> -> FunPtr (CString -> CUInt -> Ptr () -> CInt) -> Ptr () -> IO (CInt)-{- typedef enum {- GIT_STATUS_SHOW_INDEX_AND_WORKDIR = 0,- GIT_STATUS_SHOW_INDEX_ONLY = 1,- GIT_STATUS_SHOW_WORKDIR_ONLY = 2,- GIT_STATUS_SHOW_INDEX_THEN_WORKDIR = 3- } git_status_show_t; -}-#integral_t git_status_show_t-#num GIT_STATUS_SHOW_INDEX_AND_WORKDIR-#num GIT_STATUS_SHOW_INDEX_ONLY-#num GIT_STATUS_SHOW_WORKDIR_ONLY-#num GIT_STATUS_SHOW_INDEX_THEN_WORKDIR-{- enum {- GIT_STATUS_OPT_INCLUDE_UNTRACKED = 1 << 0,- GIT_STATUS_OPT_INCLUDE_IGNORED = 1 << 1,- GIT_STATUS_OPT_INCLUDE_UNMODIFIED = 1 << 2,- GIT_STATUS_OPT_EXCLUDE_SUBMODULED = 1 << 3,- GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS = 1 << 4-}; -}-#num GIT_STATUS_OPT_INCLUDE_UNTRACKED-#num GIT_STATUS_OPT_INCLUDE_IGNORED-#num GIT_STATUS_OPT_INCLUDE_UNMODIFIED-#num GIT_STATUS_OPT_EXCLUDE_SUBMODULED-#num GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS-{- typedef struct {- git_status_show_t show; unsigned int flags; git_strarray pathspec;- } git_status_options; -}-#starttype git_status_options-#field show , <git_status_show_t>-#field flags , CUInt-#field pathspec , <git_strarray>-#stoptype-#ccall git_status_foreach_ext , Ptr <git_repository> -> Ptr <git_status_options> -> FunPtr (CString -> CUInt -> Ptr () -> CInt) -> Ptr () -> IO (CInt)-#ccall git_status_file , Ptr CUInt -> Ptr <git_repository> -> CString -> IO (CInt)-#ccall git_status_should_ignore , Ptr CInt -> Ptr <git_repository> -> CString -> IO (CInt)
− src/Bindings/Libgit2/Submodule.hsc
@@ -1,50 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Submodule where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-{- typedef enum {- GIT_SUBMODULE_UPDATE_CHECKOUT = 0,- GIT_SUBMODULE_UPDATE_REBASE = 1,- GIT_SUBMODULE_UPDATE_MERGE = 2- } git_submodule_update_t; -}-#integral_t git_submodule_update_t-#num GIT_SUBMODULE_UPDATE_CHECKOUT-#num GIT_SUBMODULE_UPDATE_REBASE-#num GIT_SUBMODULE_UPDATE_MERGE-{- typedef enum {- GIT_SUBMODULE_IGNORE_ALL = 0,- GIT_SUBMODULE_IGNORE_DIRTY = 1,- GIT_SUBMODULE_IGNORE_UNTRACKED = 2,- GIT_SUBMODULE_IGNORE_NONE = 3- } git_submodule_ignore_t; -}-#integral_t git_submodule_ignore_t-#num GIT_SUBMODULE_IGNORE_ALL-#num GIT_SUBMODULE_IGNORE_DIRTY-#num GIT_SUBMODULE_IGNORE_UNTRACKED-#num GIT_SUBMODULE_IGNORE_NONE-{- typedef struct {- char * name;- char * path;- char * url;- git_oid oid;- git_submodule_update_t update;- git_submodule_ignore_t ignore;- int fetch_recurse;- int refcount;- } git_submodule; -}-#starttype git_submodule-#field name , CString-#field path , CString-#field url , CString-#field oid , <git_oid>-#field update , <git_submodule_update_t>-#field ignore , <git_submodule_ignore_t>-#field fetch_recurse , CInt-#field refcount , CInt-#stoptype-#ccall git_submodule_foreach , Ptr <git_repository> -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)-#ccall git_submodule_lookup , Ptr (Ptr <git_submodule>) -> Ptr <git_repository> -> CString -> IO (CInt)
− src/Bindings/Libgit2/Tag.hsc
@@ -1,26 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Tag where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-import Bindings.Libgit2.Object-#cinline git_tag_lookup , Ptr (Ptr <git_tag>) -> Ptr <git_repository> -> Ptr <git_oid> -> IO (CInt)-#cinline git_tag_lookup_prefix , Ptr (Ptr <git_tag>) -> Ptr <git_repository> -> Ptr <git_oid> -> CUInt -> IO (CInt)-#cinline git_tag_free , Ptr <git_tag> -> IO ()-#ccall git_tag_id , Ptr <git_tag> -> IO (Ptr <git_oid>)-#ccall git_tag_target , Ptr (Ptr <git_object>) -> Ptr <git_tag> -> IO (CInt)-#ccall git_tag_target_oid , Ptr <git_tag> -> IO (Ptr <git_oid>)-#ccall git_tag_type , Ptr <git_tag> -> IO (<git_otype>)-#ccall git_tag_name , Ptr <git_tag> -> IO (CString)-#ccall git_tag_tagger , Ptr <git_tag> -> IO (Ptr <git_signature>)-#ccall git_tag_message , Ptr <git_tag> -> IO (CString)-#ccall git_tag_create , Ptr <git_oid> -> Ptr <git_repository> -> CString -> Ptr <git_object> -> Ptr <git_signature> -> CString -> CInt -> IO (CInt)-#ccall git_tag_create_frombuffer , Ptr <git_oid> -> Ptr <git_repository> -> CString -> CInt -> IO (CInt)-#ccall git_tag_create_lightweight , Ptr <git_oid> -> Ptr <git_repository> -> CString -> Ptr <git_object> -> CInt -> IO (CInt)-#ccall git_tag_delete , Ptr <git_repository> -> CString -> IO (CInt)-#ccall git_tag_list , Ptr <git_strarray> -> Ptr <git_repository> -> IO (CInt)-#ccall git_tag_list_match , Ptr <git_strarray> -> CString -> Ptr <git_repository> -> IO (CInt)-#ccall git_tag_peel , Ptr (Ptr <git_object>) -> Ptr <git_tag> -> IO (CInt)
− src/Bindings/Libgit2/Tag.hsc.helper.c
@@ -1,6 +0,0 @@-#include <bindings.cmacros.h>-#include <git2.h>--BC_INLINE3(git_tag_lookup, git_tag**, git_repository*, const git_oid*, int)-BC_INLINE4(git_tag_lookup_prefix, git_tag**, git_repository*, const git_oid*, unsigned int, int)-BC_INLINE1VOID(git_tag_free, git_tag*)
− src/Bindings/Libgit2/Threads.hsc
@@ -1,8 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Threads where-#strict_import--import Bindings.Libgit2.Common-#ccall git_threads_init , IO ()-#ccall git_threads_shutdown , IO ()
− src/Bindings/Libgit2/Tree.hsc
@@ -1,42 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-#include <git2/tree.h>-module Bindings.Libgit2.Tree where-#strict_import--import Bindings.Libgit2.Common-import Bindings.Libgit2.Types-import Bindings.Libgit2.Oid-import Bindings.Libgit2.Object-#cinline git_tree_lookup , Ptr (Ptr <git_tree>) -> Ptr <git_repository> -> Ptr <git_oid> -> IO (CInt)-#cinline git_tree_lookup_prefix , Ptr (Ptr <git_tree>) -> Ptr <git_repository> -> Ptr <git_oid> -> CUInt -> IO (CInt)-#cinline git_tree_free , Ptr <git_tree> -> IO ()-#ccall git_tree_id , Ptr <git_tree> -> IO (Ptr <git_oid>)-#ccall git_tree_entrycount , Ptr <git_tree> -> IO (CUInt)-#ccall git_tree_entry_byname , Ptr <git_tree> -> CString -> IO (Ptr <git_tree_entry>)-#ccall git_tree_entry_byindex , Ptr <git_tree> -> CUInt -> IO (Ptr <git_tree_entry>)-#ccall git_tree_entry_attributes , Ptr <git_tree_entry> -> IO (CUInt)-#ccall git_tree_entry_name , Ptr <git_tree_entry> -> IO (CString)-#ccall git_tree_entry_id , Ptr <git_tree_entry> -> IO (Ptr <git_oid>)-#ccall git_tree_entry_type , Ptr <git_tree_entry> -> IO (<git_otype>)-#ccall git_tree_entry_to_object , Ptr (Ptr <git_object>) -> Ptr <git_repository> -> Ptr <git_tree_entry> -> IO (CInt)-#ccall git_tree_create_fromindex , Ptr <git_oid> -> Ptr <git_index> -> IO (CInt)-#ccall git_treebuilder_create , Ptr (Ptr <git_treebuilder>) -> Ptr <git_tree> -> IO (CInt)-#ccall git_treebuilder_clear , Ptr <git_treebuilder> -> IO ()-#ccall git_treebuilder_free , Ptr <git_treebuilder> -> IO ()-#ccall git_treebuilder_get , Ptr <git_treebuilder> -> CString -> IO (Ptr <git_tree_entry>)-#ccall git_treebuilder_insert , Ptr (Ptr <git_tree_entry>) -> Ptr <git_treebuilder> -> CString -> Ptr <git_oid> -> CUInt -> IO (CInt)-#ccall git_treebuilder_remove , Ptr <git_treebuilder> -> CString -> IO (CInt)-#ccall git_treebuilder_filter , Ptr <git_treebuilder> -> FunPtr (Ptr <git_tree_entry> -> Ptr () -> CInt) -> Ptr () -> IO ()-#ccall git_treebuilder_write , Ptr <git_oid> -> Ptr <git_repository> -> Ptr <git_treebuilder> -> IO (CInt)-#ccall git_tree_get_subtree , Ptr (Ptr <git_tree>) -> Ptr <git_tree> -> CString -> IO (CInt)-{- typedef int (* git_treewalk_cb)(const char * root,- git_tree_entry * entry,- void * payload); -}-#synonym_t git_treewalk_cb , CInt-{- enum git_treewalk_mode {- GIT_TREEWALK_PRE = 0, GIT_TREEWALK_POST = 1-}; -}-#num GIT_TREEWALK_PRE-#num GIT_TREEWALK_POST-#ccall git_tree_walk , Ptr <git_tree> -> CInt -> CInt -> Ptr () -> IO (CInt)
− src/Bindings/Libgit2/Tree.hsc.helper.c
@@ -1,6 +0,0 @@-#include <bindings.cmacros.h>-#include <git2.h>--BC_INLINE3(git_tree_lookup, git_tree**, git_repository*, const git_oid*, int)-BC_INLINE4(git_tree_lookup_prefix, git_tree**, git_repository*, const git_oid*, unsigned int, int)-BC_INLINE1VOID(git_tree_free, git_tree*)
− src/Bindings/Libgit2/Types.hsc
@@ -1,115 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Types where-#strict_import--import Bindings.Libgit2.Common-{- typedef int64_t git_off_t; -}-#synonym_t git_off_t , CLong-{- typedef int64_t git_time_t; -}-#synonym_t git_time_t , CLong-{- typedef enum {- GIT_OBJ_ANY = -2,- GIT_OBJ_BAD = -1,- GIT_OBJ__EXT1 = 0,- GIT_OBJ_COMMIT = 1,- GIT_OBJ_TREE = 2,- GIT_OBJ_BLOB = 3,- GIT_OBJ_TAG = 4,- GIT_OBJ__EXT2 = 5,- GIT_OBJ_OFS_DELTA = 6,- GIT_OBJ_REF_DELTA = 7- } git_otype; -}-#integral_t git_otype-#num GIT_OBJ_ANY-#num GIT_OBJ_BAD-#num GIT_OBJ__EXT1-#num GIT_OBJ_COMMIT-#num GIT_OBJ_TREE-#num GIT_OBJ_BLOB-#num GIT_OBJ_TAG-#num GIT_OBJ__EXT2-#num GIT_OBJ_OFS_DELTA-#num GIT_OBJ_REF_DELTA-{- typedef struct git_odb git_odb; -}-#opaque_t git_odb--- {- typedef struct git_odb_backend git_odb_backend; -}--- #opaque_t git_odb_backend-{- typedef struct git_odb_object git_odb_object; -}-#opaque_t git_odb_object--- {- typedef struct git_odb_stream git_odb_stream; -}--- #opaque_t git_odb_stream-{- typedef struct git_repository git_repository; -}-#opaque_t git_repository-{- typedef struct git_object git_object; -}-#opaque_t git_object-{- typedef struct git_revwalk git_revwalk; -}-#opaque_t git_revwalk-{- typedef struct git_tag git_tag; -}-#opaque_t git_tag-{- typedef struct git_blob git_blob; -}-#opaque_t git_blob-{- typedef struct git_commit git_commit; -}-#opaque_t git_commit-{- typedef struct git_tree_entry git_tree_entry; -}-#opaque_t git_tree_entry-{- typedef struct git_tree git_tree; -}-#opaque_t git_tree-{- typedef struct git_treebuilder git_treebuilder; -}-#opaque_t git_treebuilder-{- typedef struct git_index git_index; -}-#opaque_t git_index-{- typedef struct git_config git_config; -}-#opaque_t git_config--- {- typedef struct git_config_file git_config_file; -}--- #opaque_t git_config_file-{- typedef struct git_reflog_entry git_reflog_entry; -}-#opaque_t git_reflog_entry-{- typedef struct git_reflog git_reflog; -}-#opaque_t git_reflog-{- typedef struct git_note git_note; -}-#opaque_t git_note-{- typedef struct git_time {- git_time_t time; int offset;- } git_time; -}-#starttype git_time-#field time , CLong-#field offset , CInt-#stoptype-{- typedef struct git_signature {- char * name; char * email; git_time when;- } git_signature; -}-#starttype git_signature-#field name , CString-#field email , CString-#field when , <git_time>-#stoptype-{- typedef struct git_reference git_reference; -}-#opaque_t git_reference-{- typedef enum {- GIT_REF_INVALID = 0,- GIT_REF_OID = 1,- GIT_REF_SYMBOLIC = 2,- GIT_REF_PACKED = 4,- GIT_REF_HAS_PEEL = 8,- GIT_REF_LISTALL = GIT_REF_OID | GIT_REF_SYMBOLIC | GIT_REF_PACKED- } git_ref_t; -}-#integral_t git_ref_t-#num GIT_REF_INVALID-#num GIT_REF_OID-#num GIT_REF_SYMBOLIC-#num GIT_REF_PACKED-#num GIT_REF_HAS_PEEL-#num GIT_REF_LISTALL-{- typedef enum {- GIT_BRANCH_LOCAL = 1, GIT_BRANCH_REMOTE = 2- } git_branch_t; -}-#integral_t git_branch_t-#num GIT_BRANCH_LOCAL-#num GIT_BRANCH_REMOTE-{- typedef struct git_refspec git_refspec; -}-#opaque_t git_refspec-{- typedef struct git_remote git_remote; -}-#opaque_t git_remote--- {- typedef struct git_remote_head git_remote_head; -}--- #opaque_t git_remote_head
− src/Bindings/Libgit2/Version.hsc
@@ -1,5 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Version where-#strict_import-
− src/Bindings/Libgit2/Windows.hsc
@@ -1,9 +0,0 @@-#include <bindings.dsl.h>-#include <git2.h>-module Bindings.Libgit2.Windows where-#strict_import--import Bindings.Libgit2.Common-#ccall gitwin_set_codepage , CUInt -> IO ()-#ccall gitwin_get_codepage , IO (CUInt)-#ccall gitwin_set_utf8 , IO ()
− src/Data/Git.hs
@@ -1,43 +0,0 @@-module Data.Git (- module Data.Git.Repository,- -- module Data.Git.Config,- -- module Data.Git.Types,- -- module Data.Git.Revwalk,- -- module Data.Git.OdbBackend,- -- module Data.Git.Tag,- -- module Data.Git.Net,- -- module Data.Git.Refs,- -- module Data.Git.Refspec,- -- module Data.Git.Reflog,- -- module Data.Git.Commit,- -- module Data.Git.Index,- -- module Data.Git.Signature,- module Data.Git.Blob,- module Data.Git.Errors,- module Data.Git.Oid,- module Data.Git.Tree,- -- module Data.Git.Odb,- module Data.Git.Common,- module Data.Git.Object-) where--import Data.Git.Repository--- import Data.Git.Config--- import Data.Git.Types--- import Data.Git.Revwalk--- import Data.Git.OdbBackend--- import Data.Git.Tag--- import Data.Git.Net--- import Data.Git.Refs--- import Data.Git.Refspec--- import Data.Git.Reflog--- import Data.Git.Commit--- import Data.Git.Index--- import Data.Git.Signature-import Data.Git.Blob-import Data.Git.Errors-import Data.Git.Oid-import Data.Git.Tree--- import Data.Git.Odb-import Data.Git.Common-import Data.Git.Object
− src/Data/Git/Blob.hs
@@ -1,105 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-}--module Data.Git.Blob- ( Blob(..), HasBlob(..)- , createBlob- , getBlobContents- , writeBlob )- where--import Bindings.Libgit2-import Data.ByteString as B hiding (map)-import Data.ByteString.Unsafe-import Data.Git.Common-import Data.Git.Errors-import Data.Git.Internal-import Data.Text as T hiding (map)-import Prelude hiding (FilePath)--default (Text)--data Blob = Blob { _blobInfo :: Base Blob- , _blobContents :: B.ByteString }--makeClassy ''Blob--instance Show Blob where- show x = case x^.blobInfo.gitId of- Left _ -> "Blob"- Right y -> "Blob#" ++ show y--instance Updatable Blob where- update = writeBlob---- | Create a new blob in the 'Repository', with 'ByteString' as its contents.------ Note that since empty blobs cannot exist in Git, no means is provided for--- creating one; if the give string is 'empty', it is an error.-createBlob :: Repository -> B.ByteString -> Blob-createBlob repo text- | text == B.empty = error "Cannot create an empty blob"- | otherwise = Blob { _blobInfo = newBase repo (Left doWriteBlob) Nothing- , _blobContents = text }--lookupBlob :: Repository -> Oid -> IO (Maybe Blob)-lookupBlob repo oid =- lookupObject' repo oid c'git_blob_lookup c'git_blob_lookup_prefix- (\coid obj _ ->- return Blob { _blobInfo = newBase repo (Right coid)- (Just obj)- , _blobContents = B.empty })--getBlobContents :: Blob -> IO (Blob, B.ByteString)-getBlobContents b =- case b^.blobInfo.gitId of- Left _ -> return $ (b, contents)- Right hash ->- if contents /= B.empty- then return (b, contents)- else- case b^.blobInfo.gitObj of- Just blobPtr ->- withForeignPtr blobPtr $ \ptr -> do- size <- c'git_blob_rawsize (castPtr ptr)- buf <- c'git_blob_rawcontent (castPtr ptr)- bstr <- curry unsafePackCStringLen (castPtr buf)- (fromIntegral size)- return (blobContents .~ bstr $ b, bstr)-- Nothing -> do- b' <- lookupBlob repo (Oid hash)- case b' of- Just blobPtr' -> getBlobContents blobPtr'- Nothing -> return (b, B.empty)-- where repo = b^.blobInfo.gitRepo- contents = b^.blobContents---- | Write out a blob to its repository. If it has already been written,--- nothing will happen.-writeBlob :: Blob -> IO Blob-writeBlob b@(Blob { _blobInfo = Base { _gitId = Right _ } }) = return b-writeBlob b = do hash <- doWriteBlob b- return $ blobInfo.gitId .~ Right hash $- blobContents .~ B.empty $ b--doWriteBlob :: Blob -> IO COid-doWriteBlob b = do- ptr <- mallocForeignPtr- r <- withForeignPtr repo (createFromBuffer ptr)- when (r < 0) $ throwIO BlobCreateFailed- return (COid ptr)-- where- repo = fromMaybe (error "Repository invalid") $- b^.blobInfo.gitRepo.repoObj-- createFromBuffer ptr repoPtr =- unsafeUseAsCStringLen (b^.blobContents) $- uncurry (\cstr len ->- withForeignPtr ptr $ \ptr' ->- c'git_blob_create_frombuffer- ptr' repoPtr (castPtr cstr) (fromIntegral len))---- Blob.hs
− src/Data/Git/Commit.hs
@@ -1,31 +0,0 @@-{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-}--module Data.Git.Commit where--import Bindings.Libgit2-import Control.Lens-import Data.Either-import Data.Git.Common-import Data.Git.Internal-import Data.Git.Tree-import Data.Text as T hiding (map)-import Prelude hiding (FilePath)--default (Text)--data Commit = Commit { _commitInfo :: Base Commit- , _commitWho :: WhoWhen- , _commitLog :: Text- , _commitTree :: Tree- , _commitObj :: ObjPtr C'git_commit }--makeClassy ''Commit--instance Show Commit where- show x = case x^.commitInfo.gitId of- Left _ -> "Commit"- Right y -> "Commit#" ++ show y---- Commit.hs
− src/Data/Git/Common.hs
@@ -1,34 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-}--module Data.Git.Common- ( Author, HasAuthor(..)- , WhoWhen, HasWhoWhen(..)- , Base(..), gitId, gitRepo- , newBase )- where--import Control.Lens-import Data.Either-import Data.Git.Internal-import Data.Text as T hiding (map)-import Data.Time-import Prelude hiding (FilePath)--default (Text)--data Author = Author { _authorName :: Text- , _authorEmail :: Text }- deriving (Show, Eq)--makeClassy ''Author--data WhoWhen = WhoWhen { _whoAuthor :: Author- , _whoAuthorDate :: UTCTime- , _whoCommitter :: Author- , _whoCommitterDate :: UTCTime }- deriving (Show, Eq)--makeClassy ''WhoWhen---- Common.hs
− src/Data/Git/Errors.hs
@@ -1,21 +0,0 @@-{-# LANGUAGE DeriveDataTypeable #-}--module Data.Git.Errors- ( GitException(..) )- where--import Control.Exception-import Data.Typeable-import Prelude hiding (FilePath)--data GitException = RepositoryNotExist String- | RepositoryInvalid- | BlobCreateFailed- | ObjectLookupFailed- | ObjectIdTooLong- | OidCopyFailed- deriving (Show, Typeable)--instance Exception GitException---- Errors.hs
− src/Data/Git/Internal.hs
@@ -1,149 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE TypeSynonymInstances #-}-{-# LANGUAGE FlexibleInstances #-}--module Data.Git.Internal- ( ObjPtr-- , Updatable(..)-- , Base(..), gitId, gitRepo, gitObj- , newBase-- , Repository- , HasRepository(..)-- , openRepository- , createRepository- , openOrCreateRepository- , repositoryPtr-- , lookupObject'-- , module X )- where--import Bindings.Libgit2 as X-import Control.Applicative as X-import Control.Exception as X-import Control.Lens as X hiding((<.>))-import Control.Monad as X hiding (mapM, mapM_, sequence, sequence_,- forM, forM_, msum)-import Data.Either as X-import Data.Foldable as X-import Data.Git.Errors as X-import Data.Git.Oid as X-import Data.Git.Stringable as X-import Data.Maybe as X-import Data.Monoid as X-import Data.Text as T hiding (map)-import Data.Traversable as X-import Filesystem as X-import Filesystem.Path.CurrentOS as X hiding (empty, concat)-import Foreign.C.String as X-import Foreign.C.Types as X-import Foreign.ForeignPtr as X-import Foreign.Marshal.Alloc as X-import Foreign.Marshal.Utils as X-import Foreign.Ptr as X-import Foreign.StablePtr as X-import Foreign.Storable as X-import Prelude hiding (FilePath, mapM, mapM_, sequence, sequence_)-import Unsafe.Coerce as X--default (Text)--type ObjPtr a = Maybe (ForeignPtr a)--class Updatable a where- update :: a -> IO a- update_ :: a -> IO ()- update_ x = void (update x)--data Repository = Repository { _repoPath :: FilePath- , _repoObj :: ObjPtr C'git_repository }--makeClassy ''Repository--instance Show Repository where- show x = "Repository " <> toString (x^.repoPath)--data Base a = Base { _gitId :: Ident a- , _gitRepo :: Repository- , _gitObj :: ObjPtr C'git_object }--makeLenses ''Base--instance Show (Base a) where- show x = case x^.gitId of- Left _ -> "Base"- Right y -> "Base#" ++ show y--newBase :: Repository -> Ident a -> ObjPtr C'git_object -> Base a-newBase repo oid obj = Base { _gitId = oid- , _gitRepo = repo- , _gitObj = obj }--repositoryPtr :: Repository -> ForeignPtr C'git_repository-repositoryPtr repo = fromMaybe (error "Repository invalid") (repo^.repoObj)--openRepository :: FilePath -> IO Repository-openRepository path =- openRepositoryWith path c'git_repository_open--createRepository :: FilePath -> Bool -> IO Repository-createRepository path bare =- openRepositoryWith path (\x y -> c'git_repository_init x y (fromBool bare))--openOrCreateRepository :: FilePath -> Bool -> IO Repository-openOrCreateRepository path bare = do- b <- isDirectory path- if b- then openRepository path- else createRepository path bare--openRepositoryWith :: FilePath- -> (Ptr (Ptr C'git_repository) -> CString -> IO CInt)- -> IO Repository-openRepositoryWith path fn = alloca $ \ptr ->- case toText path of- Left p -> doesNotExist p- Right p ->- withCStringable p $ \str -> do- r <- fn ptr str- when (r < 0) $ doesNotExist p- ptr' <- peek ptr- fptr <- newForeignPtr p'git_repository_free ptr'- return Repository { _repoPath = path- , _repoObj = Just fptr }-- where doesNotExist = throwIO . RepositoryNotExist . toString--lookupObject'- :: Repository -> Oid- -> (Ptr (Ptr a) -> Ptr C'git_repository -> Ptr C'git_oid -> IO CInt)- -> (Ptr (Ptr a) -> Ptr C'git_repository -> Ptr C'git_oid -> CUInt -> IO CInt)- -> (COid -> ForeignPtr C'git_object -> Ptr C'git_object -> IO b)- -> IO (Maybe b)-lookupObject' repo oid lookupFn lookupPrefixFn createFn = alloca $ \ptr -> do- r <- withForeignPtr (repositoryPtr repo) $ \repoPtr ->- case oid of- Oid (COid oid') ->- withForeignPtr oid' $ \oidPtr ->- lookupFn (castPtr ptr) repoPtr oidPtr- PartialOid (COid oid') len ->- withForeignPtr oid' $ \oidPtr ->- lookupPrefixFn (castPtr ptr) repoPtr oidPtr (fromIntegral len)- if r < 0- then return Nothing- else do- ptr' <- peek ptr- coid <- c'git_object_id ptr'- coidCopy <- mallocForeignPtr- withForeignPtr coidCopy $ flip c'git_oid_cpy coid-- fptr <- newForeignPtr p'git_object_free ptr'- Just <$> createFn (COid coidCopy) fptr ptr'---- Internal.hs
− src/Data/Git/Object.hs
@@ -1,62 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}--module Data.Git.Object- ( Object(..)- , Ref(..)- , revParse- , lookupObject )- where--import Data.ByteString as B hiding (map)-import Data.Git.Blob-import Data.Git.Commit-import Data.Git.Internal-import Data.Git.Tag-import Data.Git.Tree-import qualified Data.Map as M--data Object = BlobObj Blob- | TreeObj Tree- | CommitObj Commit- | TagObj Tag--data Ref a = FullHash a- | PartialHash a- | BranchName a- | TagName a- | RefName a- | FullRefName a- | Specifier a--revParse :: CStringable a => Ref a -> IO (Maybe Oid)-revParse (FullHash r) = stringToOid r-revParse (PartialHash r) = stringToOid r-revParse (BranchName r) = undefined-revParse (TagName r) = undefined-revParse (RefName r) = undefined-revParse (FullRefName r) = undefined-revParse (Specifier r) = undefined--lookupObject :: Repository -> Oid -> IO (Maybe Object)-lookupObject repo oid =- lookupObject' repo oid- (\x y z -> c'git_object_lookup x y z c'GIT_OBJ_ANY)- (\x y z l -> c'git_object_lookup_prefix x y z l c'GIT_OBJ_ANY)- (\coid x y -> c'git_object_type y >>= createObject repo coid x)--createObject :: Repository -> COid -> ForeignPtr C'git_object -> C'git_otype- -> IO Object-createObject repo coid obj typ- | typ == c'GIT_OBJ_BLOB =- return $ BlobObj Blob { _blobInfo =- newBase repo (Right coid) (Just obj)- , _blobContents = B.empty }-- | typ == c'GIT_OBJ_TREE =- return $ TreeObj Tree { _treeInfo =- newBase repo (Right coid) (Just obj)- , _treeContents = M.empty }-- | otherwise = return undefined---- Object.hs
− src/Data/Git/Oid.hs
@@ -1,84 +0,0 @@-{-# LANGUAGE FlexibleInstances #-}--module Data.Git.Oid- ( Oid(..)- , COid(..)- , Ident- , compareCOid- , compareCOidLen- , equalCOid- , stringToOid )- where--import Bindings.Libgit2.Oid-import Control.Exception-import Control.Monad-import Data.ByteString.Unsafe-import Data.Git.Errors-import Data.Git.Stringable-import Foreign.ForeignPtr-import System.IO.Unsafe--newtype COid = COid (ForeignPtr C'git_oid)--instance Show COid where- show (COid x) =- toString $ unsafePerformIO $- withForeignPtr x (unsafePackMallocCString <=< c'git_oid_allocfmt)--type Ident a = Either (a -> IO COid) COid--data Oid = Oid COid- | PartialOid COid Int- deriving Show--compareCOid :: COid -> COid -> Ordering-(COid x) `compareCOid` (COid y) =- let c = unsafePerformIO $- withForeignPtr x $ \x' ->- withForeignPtr y $ \y' ->- c'git_oid_cmp x' y'- in c `compare` 0--compareCOidLen :: COid -> COid -> Int -> Ordering-compareCOidLen (COid x) (COid y) l =- let c = unsafePerformIO $- withForeignPtr x $ \x' ->- withForeignPtr y $ \y' ->- c'git_oid_ncmp x' y' (fromIntegral l)- in c `compare` 0--instance Ord COid where- compare = compareCOid--equalCOid :: Ord a => a -> a -> Bool-x `equalCOid` y = (x `compare` y) == EQ--instance Eq COid where- (==) = equalCOid--instance Eq Oid where- (Oid x) == (Oid y) = x `equalCOid` y- (PartialOid x xl) == (PartialOid y yl) =- xl == yl && compareCOidLen x y xl == EQ- _ == _ = False--stringToOid :: CStringable a => a -> IO (Maybe Oid)-stringToOid str- | len > 40 = throwIO ObjectIdTooLong- | otherwise = do- oid <- mallocForeignPtr- withCStringable str $ \cstr ->- withForeignPtr oid $ \ptr -> do- r <- if len == 40- then c'git_oid_fromstr ptr cstr- else c'git_oid_fromstrn ptr cstr (fromIntegral len)- if r < 0- then return Nothing- else return . Just $ if len == 40- then Oid (COid oid)- else PartialOid (COid oid) len-- where len = lengthStr str---- Oid.hs
− src/Data/Git/Repository.hs
@@ -1,21 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-}--module Data.Git.Repository- ( Oid- , Ident- , ObjPtr-- , Updatable(..)-- , Repository- , HasRepository(..)-- , openRepository- , createRepository- , openOrCreateRepository )- where--import Data.Git.Internal---- Repository.hs
− src/Data/Git/Stringable.hs
@@ -1,87 +0,0 @@-{-# LANGUAGE FlexibleInstances #-}--module Data.Git.Stringable- ( Stringable(..)- , CStringable(..) )- where--import qualified Data.ByteString as B-import qualified Data.ByteString.Lazy as BL-import qualified Data.ByteString.Unsafe as BU-import Data.Either-import qualified Data.Text as T hiding (map)-import qualified Data.Text.Encoding as E-import qualified Data.Text.Lazy as TL-import qualified Data.Text.Lazy.Encoding as EL-import Filesystem.Path.CurrentOS hiding (empty, concat)-import Foreign.C.String-import Prelude hiding (FilePath)--class Stringable a where- toString :: a -> String- fromString :: String -> a- lengthStr :: a -> Int--instance Stringable String where- toString = id- fromString = id- lengthStr = length--instance Stringable T.Text where- toString = T.unpack- fromString = T.pack- lengthStr = T.length--instance Stringable TL.Text where- toString = TL.unpack- fromString = TL.pack- lengthStr = undefined--instance Stringable B.ByteString where- toString = T.unpack . E.decodeUtf8- fromString = E.encodeUtf8 . T.pack- lengthStr = B.length--instance Stringable BL.ByteString where- toString = TL.unpack . EL.decodeUtf8- fromString = EL.encodeUtf8 . TL.pack- lengthStr = undefined--instance Stringable FilePath where- toString = toString . either id id . toText- fromString = fromText . T.pack- lengthStr = undefined--class Stringable a => CStringable a where- withCStringable :: a -> (CString -> IO b) -> IO b- withCStringable = withCString . toString-- withCStringLenable :: a -> (CString -> Int -> IO b) -> IO b- withCStringLenable str f = withCStringLen (toString str) (uncurry f)--instance CStringable String where- withCStringable = withCString--withByteString :: B.ByteString -> (CString -> IO a) -> IO a-withByteString = BU.unsafeUseAsCString--withByteStringLen :: B.ByteString -> (CString -> Int -> IO a) -> IO a-withByteStringLen str f = BU.unsafeUseAsCStringLen str (uncurry f)--instance CStringable T.Text where- withCStringable = withCStringable . E.encodeUtf8- withCStringLenable = withCStringLenable . E.encodeUtf8--instance CStringable TL.Text where- withCStringable = withCStringable . EL.encodeUtf8- withCStringLenable = withCStringLenable . EL.encodeUtf8--instance CStringable B.ByteString where- withCStringable = withByteString- withCStringLenable = withByteStringLen--instance CStringable BL.ByteString where- withCStringable = withByteString . B.concat . BL.toChunks- withCStringLenable = withByteStringLen . B.concat . BL.toChunks---- Stringable.hs
− src/Data/Git/Tag.hs
@@ -1,25 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-}--module Data.Git.Tag where--import Control.Lens-import Data.Either-import Data.Git.Common-import Data.Git.Internal-import Data.Text as T hiding (map)-import Prelude hiding (FilePath)--default (Text)--data Tag = Tag { _tagInfo :: Base Tag- , _tagRef :: Oid }--makeClassy ''Tag--instance Show Tag where- show x = case x^.tagInfo.gitId of- Left _ -> "Tag"- Right y -> "Tag#" ++ show y---- Tag.hs
− src/Data/Git/Tree.hs
@@ -1,84 +0,0 @@-{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-}--module Data.Git.Tree where--import Bindings.Libgit2-import Control.Lens-import Data.Either-import Data.Git.Common-import Data.Git.Internal-import Data.Git.Blob-import Data.Git.Errors-import Data.Map as M hiding (map)-import Data.Text as T hiding (map)-import Prelude hiding (FilePath)--default (Text)--type TreeOrBlob = Either Blob Tree-type TreeMap = Map Text TreeOrBlob--data Tree = Tree { _treeInfo :: Base Tree- , _treeContents :: TreeMap }--makeClassy ''Tree--instance Show Tree where- show x = case x^.treeInfo.gitId of- Left _ -> "Tree"- Right y -> "Tree#" ++ show y--newTreeBase :: Tree -> Base Tree-newTreeBase t = newBase (t^.treeInfo.gitRepo) (Left doWriteTree) Nothing---- | Create a new tree, starting it with the contents at the given path.------ Note that since empty trees cannot exist in Git, no means is provided for--- creating one.-createTree :: Repository -> FilePath -> TreeOrBlob -> Tree-createTree repo path item = updateTree path item (emptyTree repo)--doWriteTree :: Tree -> IO COid-doWriteTree = undefined-{-- alloca $ \ptr ->- tb <- c'git_treebuilder_create ptr str- when (r < 0) $ throwIO (RepositoryNotExist p)- ptr' <- peek ptr- let finalizer = newForeignPtr p'git_repository_free ptr'- return $ Repository { _repoPath = path- , _repoObj = finalizer }--}--emptyTree :: Repository -> Tree-emptyTree repo =- Tree { _treeInfo = newBase repo (Left doWriteTree) Nothing- , _treeContents = M.empty }--doUpdateTree :: [Text] -> TreeOrBlob -> Tree -> Tree-doUpdateTree (x:xs) item t =- treeInfo .~ newTreeBase t $- treeContents .~ update' xs $ t-- where repo = t^.treeInfo.gitRepo- treeMap = t^.treeContents- update' [] = insert x item treeMap- update' _ = insert x subTree treeMap- subTree = Right $ doUpdateTree xs item tree'- tree' = case M.lookup x treeMap of- Just (Right m) -> m- _ -> emptyTree repo-doUpdateTree [] _ _ = undefined--updateTree :: FilePath -> TreeOrBlob -> Tree -> Tree-updateTree = doUpdateTree . splitPath--splitPath :: FilePath -> [Text]-splitPath path = splitOn "/" text- where text = case toText path of- Left x -> error $ "Invalid path: " ++ T.unpack x- Right y -> y---- Tree.hs
tests/Main.hs view
@@ -1,62 +1,24 @@-{-# LANGUAGE OverloadedStrings #-}- module Main where -import Bindings.Libgit2-import Control.Monad-import Data.Foldable-import Data.Git-import Data.Text as T hiding (map)-import Data.Text.IO-import qualified Data.Text.Encoding as E-import Filesystem.Path.CurrentOS-import Foreign.C.String-import Foreign.Marshal.Alloc-import Foreign.Storable-import Prelude hiding (FilePath, putStr, putStrLn)-import System.Exit-import System.Process(system)+import Bindings.Libgit2+import Control.Monad+import Foreign.C.String+import Foreign.Marshal.Alloc+import Foreign.Storable+import Prelude+import System.Exit+import System.Process (system) -default (Text)- main :: IO () main = do putStrLn "Creating Git repository..."- _ <- system "git init smoke.git" putStrLn "Accessing directly..."- alloca $ \ptr -> do withCString "smoke.git/.git" $ \str -> do r <- c'git_repository_open ptr str when (r < 0) $ exitWith (ExitFailure 1) peek ptr >>= c'git_repository_free-- putStrLn "Accessing via higher-level types..."-- repo <- openRepository (fromText "smoke.git/.git")- update_ $ createBlob repo (E.encodeUtf8 "Hello, world!\n")-- putStrLn "Looking up Blob by its full SHA..."- catBlob repo "af5626b4a114abcb82d63db7c8082c3c4756e51b"-- putStrLn "Looking up Blob by its short SHA..."- catBlob repo "af5626b"--catBlob :: Repository -> Text -> IO ()-catBlob repo sha = do- hash <- stringToOid sha- print hash- for_ hash $ \hash' -> do- obj <- lookupObject repo hash'- case obj of- Just (BlobObj b) -> do- putStrLn "Found a blob, contents: "- (_, contents) <- getBlobContents b- putStr (E.decodeUtf8 contents)-- Just _ -> error "Found something else..."- Nothing -> error "Didn't find anything :(" -- Main.hs ends here