gitlib-1.3.1: API library for working with Git repositories

Safe HaskellNone

Git

Description

Interface for working with Git repositories.

Synopsis

Documentation

class (Applicative m, Monad m, Failure GitException m, IsOid (Oid m)) => Repository m whereSource

Repository is the central point of contact between user code and Git data objects. Every object must belong to some repository.

Associated Types

type Oid m :: *Source

data Tree m :: *Source

data Options m :: *Source

Methods

facts :: m RepositoryFactsSource

parseOid :: Text -> m (Oid m)Source

parseObjOid :: forall o. Text -> m (Tagged o (Oid m))Source

createReference :: Text -> RefTarget m (Commit m) -> m (Reference m (Commit m))Source

createReference_ :: Text -> RefTarget m (Commit m) -> m ()Source

lookupReference :: Text -> m (Maybe (Reference m (Commit m)))Source

updateReference :: Text -> RefTarget m (Commit m) -> m (Reference m (Commit m))Source

updateReference_ :: Text -> RefTarget m (Commit m) -> m ()Source

deleteReference :: Text -> m ()Source

allReferences :: m [Reference m (Commit m)]Source

allReferenceNames :: m [Text]Source

resolveReference :: Text -> m (Maybe (CommitRef m))Source

lookupCommit :: CommitOid m -> m (Commit m)Source

lookupTree :: TreeOid m -> m (Tree m)Source

lookupBlob :: BlobOid m -> m (Blob m)Source

lookupTag :: TagOid m -> m (Tag m)Source

lookupObject :: Text -> m (Object m)Source

existsObject :: Oid m -> m BoolSource

traverseObjects :: forall a. (Object m -> m a) -> Maybe (CommitName m) -> m [a]Source

traverseObjects_ :: (Object m -> m ()) -> Maybe (CommitName m) -> m ()Source

pushCommit :: (MonadTrans t, MonadGit m, MonadGit (t m), Repository m, Repository (t m)) => CommitName m -> Maybe Text -> Text -> t m (CommitRef (t m))Source

traverseCommits :: forall a. (CommitRef m -> m a) -> CommitName m -> m [a]Source

traverseCommits_ :: (CommitRef m -> m ()) -> CommitName m -> m ()Source

missingObjectsSource

Arguments

:: Maybe (CommitName m)

A commit we may already have

-> CommitName m

The commit we need

-> m [Object m]

All the objects in between

newTreeBuilder :: Maybe (Tree m) -> m (TreeBuilder m)Source

treeOid :: Tree m -> TreeOid mSource

getTreeEntry :: Tree m -> FilePath -> m (Maybe (TreeEntry m))Source

traverseEntries :: (FilePath -> TreeEntry m -> m a) -> Tree m -> m [a]Source

traverseEntries_ :: (FilePath -> TreeEntry m -> m a) -> Tree m -> m ()Source

hashContents :: BlobContents m -> m (BlobOid m)Source

createBlob :: BlobContents m -> m (BlobOid m)Source

createCommit :: [CommitRef m] -> TreeRef m -> Signature -> Signature -> Text -> Maybe Text -> m (Commit m)Source

createTag :: CommitOid m -> Signature -> Text -> Text -> m (Tag m)Source

deleteRepository :: m ()Source

buildPackFile :: FilePath -> [Either (CommitOid m) (TreeOid m)] -> m FilePathSource

buildPackIndex :: FilePath -> ByteString -> m (Text, FilePath, FilePath)Source

writePackFile :: FilePath -> m ()Source

remoteFetch :: Text -> Text -> m ()Source

data RepositoryFactory t m c Source

Constructors

RepositoryFactory 

Fields

openRepository :: RepositoryOptions -> m c
 
runRepository :: forall a. c -> t m a -> m a
 
closeRepository :: c -> m ()
 
getRepository :: t m c
 
defaultOptions :: !RepositoryOptions
 
startupBackend :: m ()
 
shutdownBackend :: m ()
 

class (Eq o, Ord o, Show o) => IsOid o whereSource

Instances

copyOid :: (Repository m, Repository n) => Oid m -> n (Oid n)Source

data Object m Source

Constructors

BlobObj !(BlobRef m) 
TreeObj !(TreeRef m) 
CommitObj !(CommitRef m) 
TagObj !(TagRef m) 

data ObjRef m a Source

Constructors

ByOid !(Tagged a (Oid m)) 
Known !a 

newtype SHA Source

Constructors

SHA ByteString 

data Blob m Source

Constructors

Blob 

Fields

blobOid :: !(BlobOid m)
 
blobContents :: !(BlobContents m)
 

type BlobOid m = Tagged (Blob m) (Oid m)Source

type BlobRef m = ObjRef m (Blob m)Source

data TreeT m a Source

Instances

data TreeEntry m Source

Constructors

BlobEntry 
TreeEntry 

Fields

treeEntryOid :: !(TreeOid m)
 
CommitEntry 

Fields

commitEntryOid :: !(CommitOid m)
 

type TreeOid m = Tagged (Tree m) (Oid m)Source

type TreeRef m = ObjRef m (Tree m)Source

withNewTree :: Repository m => TreeT m a -> m (a, TreeRef m)Source

mutateTree :: Repository m => Tree m -> TreeT m a -> m (TreeRef m)Source

withTree :: Repository m => Tree m -> TreeT m a -> m (a, TreeRef m)Source

withTreeRef :: Repository m => TreeRef m -> TreeT m a -> m (a, TreeRef m)Source

treeRef :: Tree m -> TreeRef mSource

A Tree is anything that is treeish.

type CommitOid m = Tagged (Commit m) (Oid m)Source

genericPushCommit :: (Repository m, Repository (t m), MonadTrans t) => CommitName m -> Text -> t m (CommitRef (t m))Source

Fast-forward push a reference between repositories using a recursive copy. This can be extremely slow, but always works.

data PinnedEntry m Source

Constructors

PinnedEntry 

data Tag m Source

Constructors

Tag 

Fields

tagOid :: !(TagOid m)
 
tagCommit :: !(CommitRef m)
 

type TagOid m = Tagged (Tag m) (Oid m)Source

type TagRef m = ObjRef m (Tag m)Source

data RefTarget m a Source

Constructors

RefObj !(ObjRef m a) 
RefSymbolic !Text 

data Reference m a Source

Constructors

Reference 

allMissingObjects :: Repository m => [Object m] -> m [Object m]Source

Given a list of objects (commit and top-level trees) return by missingObjects, expand it to include all subtrees and blobs as well. Ordering is preserved.