Safe Haskell | None |
---|
- type RawFilePath = ByteString
- data RepositoryFacts = RepositoryFacts {}
- type RefName = Text
- type CommitAuthor = Text
- type CommitEmail = Text
- type CommitMessage = Text
- type TreeFilePath = RawFilePath
- class (Applicative m, Monad m, MonadThrow m, IsOid (Oid r), Show (Oid r), Eq (Oid r), Ord (Oid r)) => MonadGit r m | m -> r where
- type Oid r :: *
- data Tree r :: *
- data Options r :: *
- facts :: m RepositoryFacts
- parseOid :: Text -> m (Oid r)
- getRepository :: m r
- closeRepository :: m ()
- deleteRepository :: m ()
- createReference :: RefName -> RefTarget r -> m ()
- lookupReference :: RefName -> m (Maybe (RefTarget r))
- updateReference :: RefName -> RefTarget r -> m ()
- deleteReference :: RefName -> m ()
- sourceReferences :: Producer m RefName
- lookupObject :: Oid r -> m (Object r m)
- existsObject :: Oid r -> m Bool
- sourceObjects :: Maybe (CommitOid r) -> CommitOid r -> Bool -> Producer m (ObjectOid r)
- lookupCommit :: CommitOid r -> m (Commit r)
- lookupTree :: TreeOid r -> m (Tree r)
- lookupBlob :: BlobOid r -> m (Blob r m)
- lookupTag :: TagOid r -> m (Tag r)
- readIndex :: TreeT r m ()
- writeIndex :: TreeT r m ()
- newTreeBuilder :: Maybe (Tree r) -> m (TreeBuilder r m)
- treeOid :: Tree r -> m (TreeOid r)
- treeEntry :: Tree r -> TreeFilePath -> m (Maybe (TreeEntry r))
- sourceTreeEntries :: Tree r -> Producer m (TreeFilePath, TreeEntry r)
- diffContentsWithTree :: Source m (Either TreeFilePath ByteString) -> Tree r -> Producer m ByteString
- hashContents :: BlobContents m -> m (BlobOid r)
- createBlob :: BlobContents m -> m (BlobOid r)
- createCommit :: [CommitOid r] -> TreeOid r -> Signature -> Signature -> CommitMessage -> Maybe RefName -> m (Commit r)
- createTag :: CommitOid r -> Signature -> CommitMessage -> Text -> m (Tag r)
- data RepositoryOptions = RepositoryOptions {
- repoPath :: !FilePath
- repoWorkingDir :: !(Maybe FilePath)
- repoIsBare :: !Bool
- repoAutoCreate :: !Bool
- defaultRepositoryOptions :: RepositoryOptions
- data RepositoryFactory n m r = RepositoryFactory {
- openRepository :: RepositoryOptions -> m r
- runRepository :: forall a. r -> n a -> m a
- class IsOid o where
- renderOid :: o -> Text
- renderObjOid :: Tagged a o -> Text
- type BlobOid r = Tagged r (Oid r)
- type TreeOid r = Tagged (Tree r) (Oid r)
- type CommitOid r = Tagged (Commit r) (Oid r)
- type TagOid r = Tagged (Tag r) (Oid r)
- data ObjectOid r
- = BlobObjOid !(BlobOid r)
- | TreeObjOid !(TreeOid r)
- | CommitObjOid !(CommitOid r)
- | TagObjOid !(TagOid r)
- parseObjOid :: MonadGit r m => forall o. Text -> m (Tagged o (Oid r))
- copyOid :: (MonadGit r m, MonadGit s n) => Oid r -> n (Oid s)
- newtype SHA = SHA {
- getSHA :: ByteString
- shaToText :: SHA -> Text
- textToSha :: Monad m => Text -> m SHA
- data Blob r m = Blob {
- blobOid :: !(BlobOid r)
- blobContents :: !(BlobContents m)
- type ByteSource m = Source m ByteString
- data BlobContents m
- = BlobString !ByteString
- | BlobStringLazy !ByteString
- | BlobStream !(ByteSource m)
- | BlobSizedStream !(ByteSource m) !Int
- data BlobKind
- newtype TreeT r m a = TreeT {
- runTreeT :: StateT (TreeBuilder r m) m a
- data TreeEntry r
- = BlobEntry {
- blobEntryOid :: !(BlobOid r)
- blobEntryKind :: !BlobKind
- | TreeEntry {
- treeEntryOid :: !(TreeOid r)
- | CommitEntry {
- commitEntryOid :: !(CommitOid r)
- = BlobEntry {
- treeEntryToOid :: MonadGit r m => TreeEntry r -> Oid r
- data TreeBuilder r m = TreeBuilder {
- mtbBaseTreeOid :: Maybe (TreeOid r)
- mtbPendingUpdates :: HashMap TreeFilePath (TreeBuilder r m)
- mtbNewBuilder :: Maybe (Tree r) -> m (TreeBuilder r m)
- mtbWriteContents :: TreeBuilder r m -> m (ModifiedBuilder r m, TreeOid r)
- mtbLookupEntry :: TreeFilePath -> m (Maybe (TreeEntry r))
- mtbEntryCount :: m Int
- mtbPutEntry :: TreeBuilder r m -> TreeFilePath -> TreeEntry r -> m (ModifiedBuilder r m)
- mtbDropEntry :: TreeBuilder r m -> TreeFilePath -> m (ModifiedBuilder r m)
- data ModifiedBuilder r m
- = ModifiedBuilder (TreeBuilder r m)
- | BuilderUnchanged (TreeBuilder r m)
- fromBuilderMod :: ModifiedBuilder r m -> TreeBuilder r m
- data Commit r = Commit {
- commitOid :: !(CommitOid r)
- commitParents :: ![CommitOid r]
- commitTree :: !(TreeOid r)
- commitAuthor :: !Signature
- commitCommitter :: !Signature
- commitLog :: !CommitMessage
- commitEncoding :: !Text
- sourceCommitParents :: MonadGit r m => Commit r -> Producer m (Commit r)
- lookupCommitParents :: MonadGit r m => Commit r -> m [Commit r]
- data Signature = Signature {}
- defaultSignature :: Signature
- data Tag r = Tag {}
- data Object r m
- objectOid :: MonadGit r m => Object r m -> m (Oid r)
- loadObject :: MonadGit r m => ObjectOid r -> m (Object r m)
- objectToObjOid :: MonadGit r m => Object r m -> m (ObjectOid r)
- untagObjOid :: ObjectOid r -> Oid r
- data RefTarget r
- = RefObj !(Oid r)
- | RefSymbolic !RefName
- commitRefTarget :: Commit r -> RefTarget r
- data ModificationKind
- = Unchanged
- | Modified
- | Added
- | Deleted
- | TypeChanged
- data MergeStatus
- mergeStatus :: ModificationKind -> ModificationKind -> MergeStatus
- data MergeResult r
- = MergeSuccess {
- mergeCommit :: CommitOid r
- | MergeConflicted { }
- = MergeSuccess {
- copyMergeResult :: (MonadGit r m, IsOid (Oid s)) => MergeResult s -> m (MergeResult r)
- data GitException
- = BackendError Text
- | GitError Text
- | RepositoryNotExist
- | RepositoryInvalid
- | RepositoryCannotAccess Text
- | BlobCreateFailed Text
- | BlobEmptyCreateFailed
- | BlobEncodingUnknown Text
- | BlobLookupFailed
- | DiffBlobFailed Text
- | DiffPrintToPatchFailed Text
- | DiffTreeToIndexFailed Text
- | IndexAddFailed TreeFilePath Text
- | IndexCreateFailed Text
- | PathEncodingError Text
- | PushNotFastForward Text
- | TagLookupFailed Text
- | TranslationException Text
- | TreeCreateFailed Text
- | TreeBuilderCreateFailed
- | TreeBuilderInsertFailed TreeFilePath
- | TreeBuilderRemoveFailed TreeFilePath
- | TreeBuilderWriteFailed Text
- | TreeLookupFailed
- | TreeCannotTraverseBlob
- | TreeCannotTraverseCommit
- | TreeEntryLookupFailed TreeFilePath
- | TreeUpdateFailed
- | TreeWalkFailed Text
- | TreeEmptyCreateFailed
- | CommitCreateFailed
- | CommitLookupFailed Text
- | ReferenceCreateFailed RefName
- | ReferenceDeleteFailed RefName
- | RefCannotCreateFromPartialOid
- | ReferenceListingFailed Text
- | ReferenceLookupFailed RefName
- | ObjectLookupFailed Text Int
- | ObjectRefRequiresFullOid
- | OidCopyFailed
- | OidParseFailed Text
- | QuotaHardLimitExceeded Int Int
Documentation
type RawFilePath = ByteStringSource
type CommitAuthor = TextSource
type CommitEmail = TextSource
type CommitMessage = TextSource
type TreeFilePath = RawFilePathSource
class (Applicative m, Monad m, MonadThrow m, IsOid (Oid r), Show (Oid r), Eq (Oid r), Ord (Oid r)) => MonadGit r m | m -> r 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 r)Source
getRepository :: m rSource
closeRepository :: m ()Source
deleteRepository :: m ()Source
createReference :: RefName -> RefTarget r -> m ()Source
lookupReference :: RefName -> m (Maybe (RefTarget r))Source
updateReference :: RefName -> RefTarget r -> m ()Source
deleteReference :: RefName -> m ()Source
sourceReferences :: Producer m RefNameSource
lookupObject :: Oid r -> m (Object r m)Source
existsObject :: Oid r -> m BoolSource
:: Maybe (CommitOid r) | A commit we may already have |
-> CommitOid r | The commit we need |
-> Bool | Include commit trees also? |
-> Producer m (ObjectOid r) | All the objects in between |
lookupCommit :: CommitOid r -> m (Commit r)Source
lookupTree :: TreeOid r -> m (Tree r)Source
lookupBlob :: BlobOid r -> m (Blob r m)Source
lookupTag :: TagOid r -> m (Tag r)Source
readIndex :: TreeT r m ()Source
writeIndex :: TreeT r m ()Source
newTreeBuilder :: Maybe (Tree r) -> m (TreeBuilder r m)Source
treeOid :: Tree r -> m (TreeOid r)Source
treeEntry :: Tree r -> TreeFilePath -> m (Maybe (TreeEntry r))Source
sourceTreeEntries :: Tree r -> Producer m (TreeFilePath, TreeEntry r)Source
diffContentsWithTree :: Source m (Either TreeFilePath ByteString) -> Tree r -> Producer m ByteStringSource
hashContents :: BlobContents m -> m (BlobOid r)Source
createBlob :: BlobContents m -> m (BlobOid r)Source
createCommit :: [CommitOid r] -> TreeOid r -> Signature -> Signature -> CommitMessage -> Maybe RefName -> m (Commit r)Source
createTag :: CommitOid r -> Signature -> CommitMessage -> Text -> m (Tag r)Source
data RepositoryOptions Source
RepositoryOptions | |
|
data RepositoryFactory n m r Source
RepositoryFactory | |
|
BlobObjOid !(BlobOid r) | |
TreeObjOid !(TreeOid r) | |
CommitObjOid !(CommitOid r) | |
TagObjOid !(TagOid r) |
Blob | |
|
type ByteSource m = Source m ByteStringSource
data BlobContents m Source
BlobString !ByteString | |
BlobStringLazy !ByteString | |
BlobStream !(ByteSource m) | |
BlobSizedStream !(ByteSource m) !Int |
Eq (BlobContents m) |
TreeT | |
|
MonadTrans (TreeT r) | |
Monad m => Monad (TreeT r m) | |
Functor m => Functor (TreeT r m) | |
MonadFix m => MonadFix (TreeT r m) | |
MonadPlus m => MonadPlus (TreeT r m) | |
(Functor m, Monad m) => Applicative (TreeT r m) | |
(Functor m, MonadPlus m) => Alternative (TreeT r m) | |
MonadIO m => MonadIO (TreeT r m) | |
MonadLogger m => MonadLogger (TreeT r m) |
BlobEntry | |
| |
TreeEntry | |
| |
CommitEntry | |
|
treeEntryToOid :: MonadGit r m => TreeEntry r -> Oid rSource
data TreeBuilder r m Source
TreeBuilder | |
|
data ModifiedBuilder r m Source
ModifiedBuilder (TreeBuilder r m) | |
BuilderUnchanged (TreeBuilder r m) |
Monoid (ModifiedBuilder r m) | |
Semigroup (ModifiedBuilder r m) |
fromBuilderMod :: ModifiedBuilder r m -> TreeBuilder r mSource
Commit | |
|
lookupCommitParents :: MonadGit r m => Commit r -> m [Commit r]Source
loadObject :: MonadGit r m => ObjectOid r -> m (Object r m)Source
objectToObjOid :: MonadGit r m => Object r m -> m (ObjectOid r)Source
untagObjOid :: ObjectOid r -> Oid rSource
commitRefTarget :: Commit r -> RefTarget rSource
data ModificationKind Source
data MergeStatus Source
data MergeResult r Source
copyMergeResult :: (MonadGit r m, IsOid (Oid s)) => MergeResult s -> m (MergeResult r)Source
data GitException Source
There is a separate GitException
for each possible failure when
interacting with the Git repository.