-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Git object and its parser -- -- This package provides data types for Git objects, enumerator-based -- parser of Git object files and manipulation functions. @package git-object @version 0.0.0 -- | Types for Git objects and a parser of Git object files. module Data.Git -- | Parsing a Git file to GitObject. This parser based on -- attoparsec-enumerator. parseGitObject :: FilePath -> IO GitObject data GitType GtBlob :: GitType GtTree :: GitType GtCommit :: GitType GtTag :: GitType type Size = Int data GitObject GoBlob :: Size -> Blob -> GitObject GoTree :: Size -> [GitTreeEntry] -> GitObject GoCommit :: Size -> GitCommit -> GitObject GoTag :: Size -> GitTag -> GitObject type Blob = ByteString data GitTreeEntry GitTreeEntry :: FileType -> FilePath -> SHA1 -> GitTreeEntry fileType :: GitTreeEntry -> FileType fileName :: GitTreeEntry -> FilePath fileRef :: GitTreeEntry -> SHA1 data FileType RegularFile :: FileMode -> FileType Directory :: FileType SymbolicLink :: FileType GitLink :: FileType data GitCommit GitCommit :: SHA1 -> [SHA1] -> ByteString -> ByteString -> ByteString -> GitCommit commitRef :: GitCommit -> SHA1 commitParents :: GitCommit -> [SHA1] commitAuthor :: GitCommit -> ByteString committer :: GitCommit -> ByteString commitLog :: GitCommit -> ByteString data GitTag GitTag :: SHA1 -> ByteString -> ByteString -> ByteString -> ByteString -> GitTag tagRef :: GitTag -> SHA1 tagType :: GitTag -> ByteString tagName :: GitTag -> ByteString tagger :: GitTag -> ByteString tagLog :: GitTag -> ByteString newtype SHA1 SHA1 :: String -> SHA1 -- | Manipulating GitObject. module System.Git -- | Getting GitObject of 'GoBlob'/'GoTree' corresponding to -- GitPath. gitPathToGitObject :: GitPath -> IO (Either SomeException GitObject) data GitError GitDirNotExist :: GitError GitEntryNotExist :: GitError -- | Type for the path to Git repository directories. type GitDir = FilePath -- | Type for the absolute path from the project root. type GitPath = FilePath -- | Finding GitDir by tracking from the current directory to the -- root of the file system. findGitDir :: IO GitDir -- | Getting SHA1 of the project root. rootSha1 :: GitDir -> IO SHA1 -- | Getting GitObject of GoBlob corresponding to the project -- root. rootCommitObj :: GitDir -> IO GitObject -- | Getting SHA1 corresponding to GitPath. gitPathToSha1 :: GitPath -> GitDir -> IO SHA1 -- | Getting GitObject of 'GoBlob'/'GoTree' corresponding to -- GitPath. gitPathToObj :: GitPath -> GitDir -> IO GitObject -- | Getting FilePath to the Git object file according to -- SHA1. sha1ToObjFile :: SHA1 -> GitDir -> FilePath -- | Getting GitObject according to SHA1. sha1ToObj :: SHA1 -> GitDir -> IO GitObject instance Typeable GitError instance Show GitError instance Exception GitError