Gitex

Git API to a repo which is a struct implementing Gitex.Repo

Source

Summary

align_history(history)

take a commit stream (from history/2) and lazily add an index of the current branch to ease visualization and tree drawing

commit(tree_hash, repo, branches, message)

save a new commit :

get(ref, repo)

basically get_hash |> object

get(ref, repo, path)
get_hash(ref, repo)

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

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)
  • 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
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

tag :: {:tag, String.t}

branch :: {:branch, String.t}

remote :: {:remote, remote :: String.t, :head | branch :: String.t}

ref :: :head | tag | branch | remote

Functions

align_history(history)

Specs:

take a commit stream (from history/2) and lazily add an index of the current branch to ease visualization and tree drawing

Source
commit(tree_hash, repo, branches, message)

Specs:

save a new commit :

  • tree_hash is the tree which must be referenced by this commit, use "put" to construct it
  • branches hashes will be commit parents, and these branches specs will be updated after commit
  • committer and author are taken from Gitex.Repo.user or Application.get_env(:gitex,:anonymous_user) if nil
Source
get(ref, repo)

basically get_hash |> object

Source
get(ref, repo, path)
Source
get_hash(ref, repo)

Specs:

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

Source
get_hash(tree, repo, path)

from a reference, use a path to get the wanted object : tree or blob

Source
get_hash(hash, tree, repo, path)
Source
history(ref, repo)

Specs:

lazily stream parents of a reference commit, sorted by date

Source
object(hash, repo)

Specs:

get the decoded GIT object associated with a given hash

Source
put(tree, repo, path, elem)

Specs:

  • 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
Source
save_object(elem, repo)

Specs:

save the GIT object and return the created hash

Source
tag(hash, repo, tag)

create a new soft tag to reference an object

Source
tag(hash, repo, tag, message)

create an annottated tag to reference an object

Source