Safe Haskell | Safe-Inferred |
---|
Higher level wrapper around the hlibgit2 binding to libgit2.
Synopsis
- initialize :: IO a -> IO a
- data Blob
- data Tree
- type Repo = FilePath
- type FileName = FilePath
- type Ref = FilePath
- init :: Repo -> IO Bool
- write_blob :: Repo -> ByteString.ByteString -> IO Blob
- read_blob :: Repo -> Blob -> IO ByteString.ByteString
- data Modification
- type ModifyDir = [(FileName, ModifyFile)]
- data ModifyFile
- modifications_to_dir :: [Modification] -> ModifyDir
- write_tree :: Repo -> Maybe Tree -> [(FileName, Maybe (Either Blob Tree))] -> IO Tree
- modify_tree :: Repo -> Tree -> [Modification] -> IO Tree
- read_tree :: Repo -> Tree -> IO [(FileName, Either Blob Tree)]
- data CommitData = CommitData {
- commit_tree :: !Tree
- commit_parents :: ![Commit]
- commit_author :: !String
- commit_text :: !String
- parse_commit :: String -> Maybe Commit
- write_commit :: Repo -> Text -> Text -> [Commit] -> Tree -> String -> IO Commit
- read_commit :: Repo -> Commit -> IO CommitData
- diff_commits :: Repo -> Commit -> Commit -> IO [Modification]
- diff_trees :: Repo -> Tree -> Tree -> IO [Modification]
- write_ref :: Repo -> Commit -> Ref -> IO ()
- read_ref :: Repo -> Ref -> IO (Maybe Commit)
- read_refs :: RepoP -> IO [Ref]
- read_ref_map :: Repo -> IO (Map Ref Commit)
- write_symbolic_ref :: Repo -> Ref -> Ref -> IO ()
- read_symbolic_ref :: Repo -> Ref -> IO (Maybe Ref)
- update_head :: Repo -> Commit -> IO ()
- read_head_commit :: Repo -> IO (Maybe Commit)
- write_head :: Repo -> Ref -> IO ()
- read_head :: Repo -> IO Ref
- read_log :: Repo -> Ref -> IO [Commit]
- read_log_from :: Repo -> Commit -> IO [Commit]
- read_log_head :: Repo -> IO [Commit]
- type Dir = Map FileName File
- data File
- make_dir :: [(FilePath, ByteString.ByteString)] -> Either String Dir
- flatten_dir :: Dir -> [(FilePath, ByteString.ByteString)]
- write_dir :: Repo -> Dir -> IO Tree
- read_dir :: Repo -> Tree -> IO Dir
- gc :: Repo -> IO ()
- throw :: String -> IO a
- newtype GitException = GitException String
Documentation
initialize :: IO a -> IO a Source #
The library has to be initialized before you call any functions.
OID
repo
blob
write_blob :: Repo -> ByteString.ByteString -> IO Blob Source #
tree
data Modification Source #
Add fname Nothing means add a directory.
Instances
Show Modification Source # | |
Defined in Util.Git showsPrec :: Int -> Modification -> ShowS # show :: Modification -> String # showList :: [Modification] -> ShowS # | |
Eq Modification Source # | |
Defined in Util.Git (==) :: Modification -> Modification -> Bool # (/=) :: Modification -> Modification -> Bool # | |
Pretty Modification Source # | |
Defined in Util.Git pretty :: Modification -> Text Source # format :: Modification -> Doc Source # formatList :: [Modification] -> Doc Source # |
type ModifyDir = [(FileName, ModifyFile)] Source #
data ModifyFile Source #
Instances
Show ModifyFile Source # | |
Defined in Util.Git showsPrec :: Int -> ModifyFile -> ShowS # show :: ModifyFile -> String # showList :: [ModifyFile] -> ShowS # | |
Eq ModifyFile Source # | |
Defined in Util.Git (==) :: ModifyFile -> ModifyFile -> Bool # (/=) :: ModifyFile -> ModifyFile -> Bool # |
modifications_to_dir :: [Modification] -> ModifyDir Source #
modify_tree :: Repo -> Tree -> [Modification] -> IO Tree Source #
Apply a list of modifications to an existing tree.
commit
data CommitData Source #
CommitData | |
|
Instances
Show CommitData Source # | |
Defined in Util.Git showsPrec :: Int -> CommitData -> ShowS # show :: CommitData -> String # showList :: [CommitData] -> ShowS # | |
Eq CommitData Source # | |
Defined in Util.Git (==) :: CommitData -> CommitData -> Bool # (/=) :: CommitData -> CommitData -> Bool # |
read_commit :: Repo -> Commit -> IO CommitData Source #
diff
diff_commits :: Repo -> Commit -> Commit -> IO [Modification] Source #
diff_trees :: Repo -> Tree -> Tree -> IO [Modification] Source #
Recursively diff two trees.
refs
symbolic refs
HEAD ref
revwalk
read_log :: Repo -> Ref -> IO [Commit] Source #
Get commits in reverse chronological order from the given ref.
read_log_head :: Repo -> IO [Commit] Source #
Get commits in reverse chronological order from the HEAD.
dir
flatten_dir :: Dir -> [(FilePath, ByteString.ByteString)] Source #
misc
GC the repo. As far as I know, there's no way to do this with libgit2, so it invokes the standalone git command.
errors
newtype GitException Source #
Instances
Exception.Exception GitException Source # | |
Defined in Util.Git | |
Show GitException Source # | |
Defined in Util.Git showsPrec :: Int -> GitException -> ShowS # show :: GitException -> String # showList :: [GitException] -> ShowS # |