Safe Haskell | None |
---|
Interface for working with Git repositories.
- data RepositoryFacts = RepositoryFacts {}
- class (Applicative m, Monad m, Failure GitException m, IsOid (Oid m)) => Repository m where
- type Oid m :: *
- type TreeKind m :: *
- type Tree m :: * -> *
- data Options m
- facts :: m RepositoryFacts
- parseOid :: Text -> m (Oid m)
- parseObjOid :: forall o. Text -> m (Tagged o (Oid m))
- createRef :: Text -> RefTarget m (Commit m) -> m (Reference m (Commit m))
- createRef_ :: Text -> RefTarget m (Commit m) -> m ()
- lookupRef :: Text -> m (Maybe (Reference m (Commit m)))
- updateRef :: Text -> RefTarget m (Commit m) -> m (Reference m (Commit m))
- updateRef_ :: Text -> RefTarget m (Commit m) -> m ()
- deleteRef :: Text -> m ()
- allRefs :: m [Reference m (Commit m)]
- allRefNames :: m [Text]
- resolveRef :: Text -> m (Maybe (CommitRef m))
- lookupCommit :: CommitOid m -> m (Commit m)
- lookupTree :: TreeOid m -> m (RepositoryTree m)
- lookupBlob :: BlobOid m -> m (Blob m)
- lookupTag :: TagOid m -> m (Tag m)
- lookupObject :: Text -> m (Object m)
- existsObject :: Oid m -> m Bool
- traverseObjects :: forall a. (Object m -> m a) -> Maybe (CommitName m) -> m [a]
- traverseObjects_ :: (Object m -> m ()) -> Maybe (CommitName m) -> m ()
- pushCommit :: (MonadTrans t, MonadGit m, MonadGit (t m), Repository m, Repository (t m)) => CommitName m -> Maybe Text -> Text -> t m (CommitRef (t m))
- traverseCommits :: forall a. (CommitRef m -> m a) -> CommitName m -> m [a]
- traverseCommits_ :: (CommitRef m -> m ()) -> CommitName m -> m ()
- missingObjects :: Maybe (CommitName m) -> CommitName m -> m [Object m]
- newTree :: m (RepositoryTree m)
- cloneTree :: RepositoryTree m -> m (RepositoryTree m)
- traverseEntries :: (FilePath -> TreeEntry m -> m a) -> RepositoryTree m -> m [a]
- traverseEntries_ :: (FilePath -> TreeEntry m -> m a) -> RepositoryTree m -> m ()
- writeTree :: RepositoryTree m -> m (TreeOid m)
- unsafeUpdateTree :: RepositoryTree m -> FilePath -> Bool -> (Maybe (TreeEntry m) -> ModifyTreeResult m) -> m (RepositoryTree m, Maybe (TreeEntry m))
- hashContents :: BlobContents m -> m (BlobOid m)
- createBlob :: BlobContents m -> m (BlobOid m)
- createCommit :: [CommitRef m] -> TreeRef m -> Signature -> Signature -> Text -> Maybe Text -> m (Commit m)
- createTag :: CommitOid m -> Signature -> Text -> Text -> m (Tag m)
- deleteRepository :: m ()
- buildPackFile :: FilePath -> [Either (CommitOid m) (TreeOid m)] -> m FilePath
- buildPackIndex :: FilePath -> ByteString -> m (Text, FilePath, FilePath)
- writePackFile :: FilePath -> m ()
- remoteFetch :: Text -> Text -> m ()
- data RepositoryFactory t m c = RepositoryFactory {
- 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 ()
- data RepositoryOptions = RepositoryOptions {
- repoPath :: !FilePath
- repoIsBare :: !Bool
- repoAutoCreate :: !Bool
- withBackendDo :: (MonadIO m, MonadBaseControl IO m) => RepositoryFactory t m a -> m b -> m b
- withRepository :: (Repository (t m), MonadTrans t, MonadBaseControl IO m, MonadIO m) => RepositoryFactory t m c -> FilePath -> t m a -> m a
- withRepository' :: (Repository (t m), MonadTrans t, MonadBaseControl IO m, MonadIO m) => RepositoryFactory t m c -> RepositoryOptions -> t m a -> m a
- type MonadGit m = (Failure GitException m, Applicative m, MonadIO m, MonadBaseControl IO m)
- class (Eq o, Ord o, Show o) => IsOid o where
- renderOid :: o -> Text
- renderObjOid :: Tagged a o -> Text
- copyOid :: (Repository m, MonadGit m, Repository n, MonadGit n) => Oid m -> n (Oid n)
- data Object m
- data ObjRef m a
- objectOid :: Repository m => Object m -> m (Oid m)
- data Blob m = Blob {
- blobOid :: !(BlobOid m)
- blobContents :: !(BlobContents m)
- type BlobOid m = Tagged (Blob m) (Oid m)
- data BlobContents m
- = BlobString !ByteString
- | BlobStream !(ByteSource m)
- | BlobSizedStream !(ByteSource m) !Int
- data BlobKind
- type ByteSource m = Producer m ByteString
- type BlobRef m = ObjRef m (Blob m)
- blobEntry :: Repository m => BlobOid m -> BlobKind -> TreeEntry m
- blobRefOid :: Repository m => BlobRef m -> BlobOid m
- resolveBlobRef :: Repository m => BlobRef m -> m (Blob m)
- data TreeT t m a
- type RepositoryTree m = Tree m (TreeKind m)
- type RepositoryTreeT m a = TreeT (RepositoryTree m) m a
- data MutableTree
- type MutableTreeT m a = TreeT (Tree m MutableTree) m a
- data PersistentTree
- type PersistentTreeT m a = TreeT (Tree m PersistentTree) m a
- data TreeEntry m
- = BlobEntry {
- blobEntryOid :: !(BlobOid m)
- blobEntryKind :: !BlobKind
- | TreeEntry {
- treeEntryRef :: !(TreeRef m)
- | CommitEntry {
- commitEntryRef :: !(CommitOid m)
- = BlobEntry {
- type TreeOid m = Tagged (RepositoryTree m) (Oid m)
- type TreeRef m = ObjRef m (RepositoryTree m)
- createTree :: Repository m => RepositoryTreeT m a -> m (RepositoryTree m)
- withNewTree :: Repository m => RepositoryTreeT m a -> m (a, RepositoryTree m)
- mutateTree :: Repository m => RepositoryTree m -> RepositoryTreeT m a -> m (RepositoryTree m)
- withTree :: Repository m => RepositoryTree m -> RepositoryTreeT m a -> m (a, RepositoryTree m)
- unsafeMutateTree :: Repository m => Tree m MutableTree -> MutableTreeT m a -> m (Tree m MutableTree)
- unsafeMutateTree_ :: Repository m => Tree m MutableTree -> MutableTreeT m a -> m ()
- unsafeWithTree :: Repository m => Tree m MutableTree -> MutableTreeT m a -> m (a, Tree m MutableTree)
- unsafeGetTree :: Monad m => RepositoryTreeT m (RepositoryTree m)
- unsafePutTree :: Monad m => RepositoryTree m -> RepositoryTreeT m ()
- dropEntry :: Repository m => FilePath -> RepositoryTreeT m ()
- getEntry :: Repository m => FilePath -> RepositoryTreeT m (Maybe (TreeEntry m))
- getTreeEntry :: Repository m => RepositoryTree m -> FilePath -> m (Maybe (TreeEntry m))
- putBlob :: Repository m => FilePath -> BlobOid m -> RepositoryTreeT m ()
- putBlob' :: Repository m => FilePath -> BlobOid m -> BlobKind -> RepositoryTreeT m ()
- putCommit :: Repository m => FilePath -> CommitOid m -> RepositoryTreeT m ()
- putEntry :: Repository m => FilePath -> TreeEntry m -> RepositoryTreeT m ()
- putTree :: Repository m => FilePath -> TreeRef m -> RepositoryTreeT m ()
- resolveTreeRef :: Repository m => TreeRef m -> m (RepositoryTree m)
- treeEntry :: Repository m => RepositoryTree m -> TreeEntry m
- treeEntryOid :: Repository m => TreeEntry m -> m (Oid m)
- treeRef :: RepositoryTree m -> TreeRef m
- treeRefOid :: Repository m => TreeRef m -> m (TreeOid m)
- data ModifyTreeResult m
- fromModifyTreeResult :: ModifyTreeResult m -> Maybe (TreeEntry m)
- toModifyTreeResult :: (TreeEntry m -> ModifyTreeResult m) -> Maybe (TreeEntry m) -> ModifyTreeResult m
- data Commit m = Commit {
- commitOid :: !(CommitOid m)
- commitParents :: ![CommitRef m]
- commitTree :: !(TreeRef m)
- commitAuthor :: !Signature
- commitCommitter :: !Signature
- commitLog :: !Text
- commitEncoding :: !Text
- type CommitOid m = Tagged (Commit m) (Oid m)
- data CommitName m
- = CommitObjectId !(CommitOid m)
- | CommitRefName !Text
- | CommitReference !(Reference m (Commit m))
- type CommitRef m = ObjRef m (Commit m)
- data Signature = Signature {
- signatureName :: !Text
- signatureEmail :: !Text
- signatureWhen :: !ZonedTime
- commitEntry :: Repository m => Commit m -> TreeEntry m
- commitNameToRef :: Repository m => CommitName m -> m (Maybe (CommitRef m))
- commitRef :: Commit m -> CommitRef m
- commitRefOid :: Repository m => CommitRef m -> CommitOid m
- commitRefTarget :: Commit c -> RefTarget m (Commit c)
- copyCommitName :: (Repository m, MonadGit m, Repository n, MonadGit n) => CommitName m -> n (Maybe (CommitName n))
- copyCommitOid :: (Repository m, MonadGit m, Repository n, MonadGit n) => CommitOid m -> n (CommitOid n)
- nameOfCommit :: Commit m -> CommitName m
- renderCommitName :: Repository m => CommitName m -> Text
- resolveCommitRef :: Repository m => CommitRef m -> m (Commit m)
- data Tag m = Tag {}
- type TagOid m = Tagged (Tag m) (Oid m)
- type TagRef m = ObjRef m (Tag m)
- tagRefOid :: Repository m => TagRef m -> TagOid m
- data RefTarget m a
- = RefObj !(ObjRef m a)
- | RefSymbolic !Text
- data Reference m a = Reference {}
- referenceToRef :: Repository m => Maybe Text -> Maybe (Reference m (Commit m)) -> m (Maybe (CommitRef m))
- data GitException
- = BackendError Text
- | GitError Text
- | RepositoryNotExist
- | RepositoryInvalid
- | RepositoryCannotAccess Text
- | BlobCreateFailed
- | BlobEmptyCreateFailed
- | BlobEncodingUnknown Text
- | BlobLookupFailed
- | PushNotFastForward Text
- | TranslationException Text
- | TreeCreateFailed Text
- | TreeBuilderCreateFailed
- | TreeBuilderInsertFailed Text
- | TreeBuilderRemoveFailed Text
- | TreeBuilderWriteFailed Text
- | TreeLookupFailed
- | TreeCannotTraverseBlob
- | TreeCannotTraverseCommit
- | TreeEntryLookupFailed FilePath
- | TreeUpdateFailed
- | TreeWalkFailed
- | CommitCreateFailed
- | CommitLookupFailed Text
- | ReferenceCreateFailed
- | ReferenceDeleteFailed Text
- | RefCannotCreateFromPartialOid
- | ReferenceListingFailed
- | ReferenceLookupFailed Text
- | ObjectLookupFailed Text Int
- | ObjectRefRequiresFullOid
- | OidCopyFailed
- | OidParseFailed Text
- | QuotaHardLimitExceeded Int Int
- data ModificationKind
- = Unchanged
- | Modified
- | Added
- | Deleted
- | TypeChanged
- data MergeStatus
- data MergeResult m
- = MergeSuccess {
- mergeCommit :: CommitOid m
- | MergeConflicted { }
- = MergeSuccess {
- mergeStatus :: ModificationKind -> ModificationKind -> MergeStatus
- copyConflict :: (Repository m, MonadGit m, Repository n, MonadGit n) => MergeResult m -> n (MergeResult n)
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.
facts :: m RepositoryFactsSource
parseOid :: Text -> m (Oid m)Source
parseObjOid :: forall o. Text -> m (Tagged o (Oid m))Source
createRef :: Text -> RefTarget m (Commit m) -> m (Reference m (Commit m))Source
createRef_ :: Text -> RefTarget m (Commit m) -> m ()Source
lookupRef :: Text -> m (Maybe (Reference m (Commit m)))Source
updateRef :: Text -> RefTarget m (Commit m) -> m (Reference m (Commit m))Source
updateRef_ :: Text -> RefTarget m (Commit m) -> m ()Source
deleteRef :: Text -> m ()Source
allRefs :: m [Reference m (Commit m)]Source
allRefNames :: m [Text]Source
resolveRef :: Text -> m (Maybe (CommitRef m))Source
lookupCommit :: CommitOid m -> m (Commit m)Source
lookupTree :: TreeOid m -> m (RepositoryTree 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
:: Maybe (CommitName m) | A commit we may already have |
-> CommitName m | The commit we need |
-> m [Object m] | All the objects in between |
newTree :: m (RepositoryTree m)Source
cloneTree :: RepositoryTree m -> m (RepositoryTree m)Source
traverseEntries :: (FilePath -> TreeEntry m -> m a) -> RepositoryTree m -> m [a]Source
traverseEntries_ :: (FilePath -> TreeEntry m -> m a) -> RepositoryTree m -> m ()Source
writeTree :: RepositoryTree m -> m (TreeOid m)Source
unsafeUpdateTree :: RepositoryTree m -> FilePath -> Bool -> (Maybe (TreeEntry m) -> ModifyTreeResult m) -> m (RepositoryTree m, Maybe (TreeEntry 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
RepositoryFactory | |
|
data RepositoryOptions Source
RepositoryOptions | |
|
withBackendDo :: (MonadIO m, MonadBaseControl IO m) => RepositoryFactory t m a -> m b -> m bSource
withRepository :: (Repository (t m), MonadTrans t, MonadBaseControl IO m, MonadIO m) => RepositoryFactory t m c -> FilePath -> t m a -> m aSource
withRepository' :: (Repository (t m), MonadTrans t, MonadBaseControl IO m, MonadIO m) => RepositoryFactory t m c -> RepositoryOptions -> t m a -> m aSource
type MonadGit m = (Failure GitException m, Applicative m, MonadIO m, MonadBaseControl IO m)Source
copyOid :: (Repository m, MonadGit m, Repository n, MonadGit n) => Oid m -> n (Oid n)Source
objectOid :: Repository m => Object m -> m (Oid m)Source
Blob | |
|
data BlobContents m Source
BlobString !ByteString | |
BlobStream !(ByteSource m) | |
BlobSizedStream !(ByteSource m) !Int |
Eq (BlobContents m) |
type ByteSource m = Producer m ByteStringSource
blobRefOid :: Repository m => BlobRef m -> BlobOid mSource
resolveBlobRef :: Repository m => BlobRef m -> m (Blob m)Source
type RepositoryTree m = Tree m (TreeKind m)Source
type RepositoryTreeT m a = TreeT (RepositoryTree m) m aSource
data MutableTree Source
type MutableTreeT m a = TreeT (Tree m MutableTree) m aSource
data PersistentTree Source
type PersistentTreeT m a = TreeT (Tree m PersistentTree) m aSource
BlobEntry | |
| |
TreeEntry | |
| |
CommitEntry | |
|
type TreeOid m = Tagged (RepositoryTree m) (Oid m)Source
type TreeRef m = ObjRef m (RepositoryTree m)Source
createTree :: Repository m => RepositoryTreeT m a -> m (RepositoryTree m)Source
withNewTree :: Repository m => RepositoryTreeT m a -> m (a, RepositoryTree m)Source
mutateTree :: Repository m => RepositoryTree m -> RepositoryTreeT m a -> m (RepositoryTree m)Source
withTree :: Repository m => RepositoryTree m -> RepositoryTreeT m a -> m (a, RepositoryTree m)Source
unsafeMutateTree :: Repository m => Tree m MutableTree -> MutableTreeT m a -> m (Tree m MutableTree)Source
unsafeMutateTree_ :: Repository m => Tree m MutableTree -> MutableTreeT m a -> m ()Source
unsafeWithTree :: Repository m => Tree m MutableTree -> MutableTreeT m a -> m (a, Tree m MutableTree)Source
unsafeGetTree :: Monad m => RepositoryTreeT m (RepositoryTree m)Source
unsafePutTree :: Monad m => RepositoryTree m -> RepositoryTreeT m ()Source
dropEntry :: Repository m => FilePath -> RepositoryTreeT m ()Source
getEntry :: Repository m => FilePath -> RepositoryTreeT m (Maybe (TreeEntry m))Source
getTreeEntry :: Repository m => RepositoryTree m -> FilePath -> m (Maybe (TreeEntry m))Source
putBlob :: Repository m => FilePath -> BlobOid m -> RepositoryTreeT m ()Source
putBlob' :: Repository m => FilePath -> BlobOid m -> BlobKind -> RepositoryTreeT m ()Source
putCommit :: Repository m => FilePath -> CommitOid m -> RepositoryTreeT m ()Source
putEntry :: Repository m => FilePath -> TreeEntry m -> RepositoryTreeT m ()Source
putTree :: Repository m => FilePath -> TreeRef m -> RepositoryTreeT m ()Source
resolveTreeRef :: Repository m => TreeRef m -> m (RepositoryTree m)Source
treeEntry :: Repository m => RepositoryTree m -> TreeEntry mSource
treeEntryOid :: Repository m => TreeEntry m -> m (Oid m)Source
treeRefOid :: Repository m => TreeRef m -> m (TreeOid m)Source
data ModifyTreeResult m Source
fromModifyTreeResult :: ModifyTreeResult m -> Maybe (TreeEntry m)Source
toModifyTreeResult :: (TreeEntry m -> ModifyTreeResult m) -> Maybe (TreeEntry m) -> ModifyTreeResult mSource
Commit | |
|
data CommitName m Source
CommitObjectId !(CommitOid m) | |
CommitRefName !Text | |
CommitReference !(Reference m (Commit m)) |
Repository m => Show (CommitName m) |
Signature | |
|
commitEntry :: Repository m => Commit m -> TreeEntry mSource
commitNameToRef :: Repository m => CommitName m -> m (Maybe (CommitRef m))Source
commitRefOid :: Repository m => CommitRef m -> CommitOid mSource
commitRefTarget :: Commit c -> RefTarget m (Commit c)Source
copyCommitName :: (Repository m, MonadGit m, Repository n, MonadGit n) => CommitName m -> n (Maybe (CommitName n))Source
copyCommitOid :: (Repository m, MonadGit m, Repository n, MonadGit n) => CommitOid m -> n (CommitOid n)Source
nameOfCommit :: Commit m -> CommitName mSource
renderCommitName :: Repository m => CommitName m -> TextSource
resolveCommitRef :: Repository m => CommitRef m -> m (Commit m)Source
tagRefOid :: Repository m => TagRef m -> TagOid mSource
referenceToRef :: Repository m => Maybe Text -> Maybe (Reference m (Commit m)) -> m (Maybe (CommitRef m))Source
data GitException Source
There is a separate GitException
for each possible failure when
interacting with the Git repository.
data ModificationKind Source
data MergeStatus Source
data MergeResult m Source
Repository m => Show (MergeResult m) |
copyConflict :: (Repository m, MonadGit m, Repository n, MonadGit n) => MergeResult m -> n (MergeResult n)Source