License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unix |
Safe Haskell | None |
Language | Haskell98 |
Synopsis
- data Git hash
- configGetAll :: Git hash -> IO [Config]
- configGet :: Git hash -> String -> String -> IO (Maybe String)
- newtype Config = Config [Section]
- data Section = Section {
- sectionName :: String
- sectionKVs :: [(String, String)]
- type HTree hash = [(ModePerm, EntName, HTreeEnt hash)]
- data HTreeEnt hash
- newtype RefName = RefName {
- refNameRaw :: String
- getCommitMaybe :: HashAlgorithm hash => Git hash -> Ref hash -> IO (Maybe (Commit hash))
- getCommit :: (Typeable hash, HashAlgorithm hash) => Git hash -> Ref hash -> IO (Commit hash)
- getTreeMaybe :: HashAlgorithm hash => Git hash -> Ref hash -> IO (Maybe (Tree hash))
- getTree :: (Typeable hash, HashAlgorithm hash) => Git hash -> Ref hash -> IO (Tree hash)
- rewrite :: (Typeable hash, HashAlgorithm hash) => Git hash -> (Commit hash -> IO (Commit hash)) -> Revision -> Int -> IO (Ref hash)
- buildHTree :: (Typeable hash, HashAlgorithm hash) => Git hash -> Tree hash -> IO (HTree hash)
- resolvePath :: (Typeable hash, HashAlgorithm hash) => Git hash -> Ref hash -> EntPath -> IO (Maybe (Ref hash))
- resolveTreeish :: HashAlgorithm hash => Git hash -> Ref hash -> IO (Maybe (Tree hash))
- resolveRevision :: (Typeable hash, HashAlgorithm hash) => Git hash -> Revision -> IO (Maybe (Ref hash))
- initRepo :: LocalPath -> IO ()
- isRepo :: LocalPath -> IO Bool
- branchWrite :: Git hash -> RefName -> Ref hash -> IO ()
- branchList :: Git hash -> IO (Set RefName)
- tagWrite :: Git hash -> RefName -> Ref hash -> IO ()
- tagList :: Git hash -> IO (Set RefName)
- headSet :: Git hash -> Either (Ref hash) RefName -> IO ()
- headGet :: HashAlgorithm hash => Git hash -> IO (Either (Ref hash) RefName)
Documentation
represent a git repo, with possibly already opened filereaders for indexes and packs
Config
:: Git hash | Git context |
-> String | section name |
-> String | key name |
-> IO (Maybe String) | The resulting value if it exists |
Get a configuration element from the config file, starting from the local repository config file, then the global config file.
for example the equivalent to git config user.name is:
configGet git "user" "name"
Section | |
|
Trees
hierarchy tree, either a reference to a blob (file) or a tree (directory).
getCommitMaybe :: HashAlgorithm hash => Git hash -> Ref hash -> IO (Maybe (Commit hash)) Source #
get a specified commit
getCommit :: (Typeable hash, HashAlgorithm hash) => Git hash -> Ref hash -> IO (Commit hash) Source #
get a specified commit but raises an exception if doesn't exists or type is not appropriate
getTreeMaybe :: HashAlgorithm hash => Git hash -> Ref hash -> IO (Maybe (Tree hash)) Source #
get a specified tree
getTree :: (Typeable hash, HashAlgorithm hash) => Git hash -> Ref hash -> IO (Tree hash) Source #
get a specified tree but raise
:: (Typeable hash, HashAlgorithm hash) | |
=> Git hash | Repository |
-> (Commit hash -> IO (Commit hash)) | Mapping function |
-> Revision | revision to start from |
-> Int | the number of parents to map |
-> IO (Ref hash) | return the new head REF |
Rewrite a set of commits from a revision and returns the new ref.
If during revision traversal (diving) there's a commit with zero or multiple parents then the traversal will stop regardless of the amount of parent requested.
calling "rewrite f 2 (revisionOf d)" on the following tree:
a <-- b <-- c <-- d
result in the following tree after mapping with f:
a <-- f(b) <-- f(c) <-- f(d)
buildHTree :: (Typeable hash, HashAlgorithm hash) => Git hash -> Tree hash -> IO (HTree hash) Source #
build a hierarchy tree from a tree object
:: (Typeable hash, HashAlgorithm hash) | |
=> Git hash | repository |
-> Ref hash | commit reference |
-> EntPath | paths |
-> IO (Maybe (Ref hash)) |
resolve the ref (tree or blob) related to a path at a specific commit ref
resolveTreeish :: HashAlgorithm hash => Git hash -> Ref hash -> IO (Maybe (Tree hash)) Source #
returns a tree from a ref that might be either a commit, a tree or a tag.
resolveRevision :: (Typeable hash, HashAlgorithm hash) => Git hash -> Revision -> IO (Maybe (Ref hash)) Source #
try to resolve a string to a specific commit ref for example: HEAD, HEAD^, master~3, shortRef
isRepo :: LocalPath -> IO Bool Source #
basic checks to see if a specific path looks like a git repo.
named refs manipulation
:: Git hash | repository |
-> RefName | the name of the branch to write |
-> Ref hash | the reference to set |
-> IO () |
Write a branch to point to a specific reference
Write a tag to point to a specific reference
Set head to point to either a reference or a branch name.