Gitex
Git API to a repo which is a struct implementing Gitex.Repo
Summary↑
align_history(history) | take a commit stream (from |
commit(tree_hash, repo, branches, message) | save a new commit : |
get(ref, repo) | basically |
get(ref, repo, path) | |
get_hash(ref, repo) | Get the decoded GIT object hash from a fuzzy reference : can be either a |
get_hash(tree, repo, path) | from a reference, use a path to get the wanted object : tree or blob |
get_hash(hash, tree, repo, path) | |
history(ref, repo) | lazily stream parents of a reference commit, sorted by date |
object(hash, repo) | get the decoded GIT object associated with a given hash |
put(tree, repo, path, elem) |
|
save_object(elem, repo) | save the GIT object and return the created hash |
tag(hash, repo, tag) | create a new soft tag to reference an object |
tag(hash, repo, tag, message) | create an annottated tag to reference an object |
Types ↑
Functions
Specs:
- align_history(Stream.t(Gitex.Repo.commit)) :: Stream.t({integer, Gitex.Repo.commit})
take a commit stream (from history/2
) and lazily add an index of the current branch to ease visualization and tree drawing
Specs:
- commit(Gitex.Repo.hash, Gitex.Repo.t, [branch :: binary] | branch :: binary, binary) :: Gitex.Repo.hash
save a new commit :
tree_hash
is the tree which must be referenced by this commit, use "put" to construct itbranches
hashes will be commit parents, and these branches specs will be updated after commit- committer and author are taken from
Gitex.Repo.user
orApplication.get_env(:gitex,:anonymous_user)
ifnil
basically get_hash |> object
Specs:
- get_hash((someref :: binary) | Gitex.Repo.commit | Gitex.Repo.tag | Gitex.Repo.tree, Gitex.Repo.t) :: Gitex.Repo.hash
- get_hash((someref :: binary) | Gitex.Repo.commit | Gitex.Repo.tag, Gitex.Repo.t) :: Gitex.Repo.hash
Get the decoded GIT object hash from a fuzzy reference : can be either a ref
or a binary which will be tested for each reference type in this order : branch,tag,remote
from a reference, use a path to get the wanted object : tree or blob
Specs:
- history(someref :: binary, Gitex.Repo.t) :: Stream.t
lazily stream parents of a reference commit, sorted by date
Specs:
- object(nil | Gitex.Repo.hash, Gitex.Repo.t) :: Gitex.Repo.gitobj
get the decoded GIT object associated with a given hash
Specs:
- put((someref :: binary) | Gitex.Repo.commit | Gitex.Repo.tag | Gitex.Repo.tree, Gitex.Repo.t, path :: binary, elem :: Gitex.Repo.blob | Gitex.Repo.tree) :: Gitex.Repo.hash
- from some reference or object, get a root tree to alter
- save the missing or changed trees and blob from the root
- return the new root tree hash
Specs:
- save_object(Gitex.Repo.gitobj, Gitex.Repo.t) :: Gitex.Repo.hash
save the GIT object and return the created hash
create a new soft tag to reference an object
create an annottated tag to reference an object