git-0.3.0: Git operations in haskell

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityunix
Safe HaskellNone
LanguageHaskell98

Data.Git.Storage

Contents

Description

 
Synopsis

Documentation

data Git hash Source #

represent a git repo, with possibly already opened filereaders for indexes and packs

packedNamed :: Git hash -> CachedPackedRef hash Source #

gitRepoPath :: Git hash -> LocalPath Source #

opening repositories

openRepo :: LocalPath -> IO (Git SHA1) Source #

open a new git repository context

closeRepo :: Git hash -> IO () Source #

close a git repository context, closing all remaining fileReaders.

withRepo :: LocalPath -> (Git SHA1 -> IO c) -> IO c Source #

execute a function f with a git context.

withCurrentRepo :: (Git SHA1 -> IO a) -> IO a Source #

execute a function on the current repository.

check findRepo to see how the git repository is found.

findRepoMaybe :: IO (Maybe LocalPath) Source #

Find the git repository from the current directory.

If the environment variable GIT_DIR is set then it's used, otherwise iterate from current directory, up to 128 parents for a .git directory

findRepo :: IO LocalPath Source #

Find the git repository from the current directory.

If the environment variable GIT_DIR is set then it's used, otherwise iterate from current directory, up to 128 parents for a .git directory

isRepo :: LocalPath -> IO Bool Source #

basic checks to see if a specific path looks like a git repo.

creating repositories

initRepo :: LocalPath -> IO () Source #

initialize a new repository at a specific location.

repository accessors

getDescription :: Git hash -> IO (Maybe String) Source #

read the repository's description

setDescription :: Git hash -> String -> IO () Source #

set the repository's description

iterators

iterateIndexes :: HashAlgorithm hash => Git hash -> (b -> (Ref hash, PackIndexReader) -> IO (b, Bool)) -> b -> IO b Source #

findReference :: HashAlgorithm hash => Git hash -> Ref hash -> IO (ObjectLocation hash) Source #

Get the object location of a specific reference

findReferencesWithPrefix :: HashAlgorithm hash => Git hash -> String -> IO [Ref hash] Source #

get all the references that start by a specific prefix

getting objects

getObjectRaw :: HashAlgorithm hash => Git hash -> Ref hash -> Bool -> IO (Maybe (ObjectInfo hash)) Source #

get an object from repository

getObjectRawAt :: HashAlgorithm hash => Git hash -> ObjectLocation hash -> Bool -> IO (Maybe (ObjectInfo hash)) Source #

get an object from repository

getObject Source #

Arguments

:: HashAlgorithm hash 
=> Git hash

repository

-> Ref hash

the object's reference to

-> Bool

whether to resolve deltas if found

-> IO (Maybe (Object hash))

returned object if found

get an object from repository using a ref.

getObject_ Source #

Arguments

:: (Typeable hash, HashAlgorithm hash) 
=> Git hash

repository

-> Ref hash

the object's reference to

-> Bool

whether to resolve deltas if found

-> IO (Object hash)

returned object if found

Just like getObject but will raise a RefNotFound exception if the reference cannot be found.

getObjectAt :: HashAlgorithm hash => Git hash -> ObjectLocation hash -> Bool -> IO (Maybe (Object hash)) Source #

get an object from repository using a location to reference it.

getObjectType :: HashAlgorithm hash => Git hash -> Ref hash -> IO (Maybe ObjectType) Source #

get an object type from repository

setting objects

setObject :: HashAlgorithm hash => Git hash -> Object hash -> IO (Ref hash) Source #

set an object in the store and returns the new ref this is always going to create a loose object.