git-0.1: 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 Source

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

packedNamed :: Git -> CachedPackedRef Source

gitRepoPath :: Git -> LocalPath Source

opening repositories

openRepo :: LocalPath -> IO Git Source

open a new git repository context

closeRepo :: Git -> IO () Source

close a git repository context, closing all remaining fileReaders.

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

execute a function f with a git context.

withCurrentRepo :: (Git -> 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 -> IO (Maybe String) Source

read the repository's description

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

set the repository's description

iterators

iterateIndexes :: Git -> (b -> (Ref, PackIndexReader) -> IO (b, Bool)) -> b -> IO b Source

findReference :: Git -> Ref -> IO ObjectLocation Source

Get the object location of a specific reference

findReferencesWithPrefix :: Git -> String -> IO [Ref] Source

get all the references that start by a specific prefix

getting objects

getObjectRaw :: Git -> Ref -> Bool -> IO (Maybe ObjectInfo) Source

get an object from repository

getObjectRawAt :: Git -> ObjectLocation -> Bool -> IO (Maybe ObjectInfo) Source

get an object from repository

getObject Source

Arguments

:: Git

repository

-> Ref

the object's reference to

-> Bool

whether to resolve deltas if found

-> IO (Maybe Object)

returned object if found

get an object from repository using a ref.

getObject_ Source

Arguments

:: Git

repository

-> Ref

the object's reference to

-> Bool

whether to resolve deltas if found

-> IO Object

returned object if found

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

getObjectAt :: Git -> ObjectLocation -> Bool -> IO (Maybe Object) Source

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

getObjectType :: Git -> Ref -> IO (Maybe ObjectType) Source

get an object type from repository

setting objects

setObject :: Git -> Object -> IO Ref Source

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