Repositories / ocaml-git.git
src/ocaml_git.mli
Clone (read-only): git clone http://git.guha-anderson.com/git/ocaml-git.git
type oid = string
type signature = {
name : string;
email : string;
epoch_seconds : int;
timezone_offset_minutes : int;
}
type commit = {
id : oid;
summary : string;
message : string;
author : signature;
committer : signature;
parent_count : int;
}
type branch_type = Local | Remote
type branch = {
name : string;
kind : branch_type;
is_head : bool;
}
type tree_entry_kind = Blob | Tree | Commit | Tag | Other
type tree_entry = {
name : string;
id : oid;
kind : tree_entry_kind;
}
type tree_listing = {
path : string;
commit : commit;
entries : tree_entry list;
}
type blob = {
path : string;
id : oid;
bytes : string;
}
type status_flag =
| Current
| Index_new
| Index_modified
| Index_deleted
| Index_renamed
| Index_type_change
| Worktree_new
| Worktree_modified
| Worktree_deleted
| Worktree_type_change
| Worktree_renamed
| Worktree_unreadable
| Ignored
| Conflicted
type status_entry = {
path : string;
flags : status_flag list;
}
exception Git_error of string
type t
type index
val open_repo : string -> t
val init : ?bare:bool -> string -> t
val discover : string -> string
val close : t -> unit
val with_repo : string -> (t -> 'a) -> 'a
val git_dir : t -> string
val workdir : t -> string option
val is_bare : t -> bool
val is_empty : t -> bool
val head_name : t -> string
val head_commit : t -> commit
val branch_commit : t -> string -> commit
val branches : t -> branch list
val status : t -> status_entry list
val tree_entry : ?commit:commit -> t -> string -> tree_entry
val tree : ?commit:commit -> ?path:string -> t -> unit -> tree_listing
val blob : ?commit:commit -> t -> string -> blob
val commits : ?limit:int -> t -> string -> commit list
val commit_lookup : t -> oid -> commit
val commit_diff : t -> oid -> string
val index : t -> index
val index_size : index -> int
val index_contains : index -> string -> bool
val index_add : index -> string -> index
val index_remove : index -> string -> index
val index_write : index -> index
val close_index : index -> unit
val blob_is_binary : blob -> bool
val blob_text : blob -> string
val shutdown : unit -> unit