git-0.2.1: Git operations in haskell

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

Data.Git.Storage.Object

Contents

Description

 

Synopsis

Documentation

data ObjectLocation hash #

location of an object in the database

Constructors

NotFound 
Loose (Ref hash) 
Packed (Ref hash) Word64 

Instances

Eq (ObjectLocation hash) # 

Methods

(==) :: ObjectLocation hash -> ObjectLocation hash -> Bool #

(/=) :: ObjectLocation hash -> ObjectLocation hash -> Bool #

Show (ObjectLocation hash) # 

data ObjectType #

type of a git object.

Instances

Enum ObjectType #

the enum instance is useful when marshalling to pack file.

Eq ObjectType # 
Data ObjectType # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ObjectType -> c ObjectType #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ObjectType #

toConstr :: ObjectType -> Constr #

dataTypeOf :: ObjectType -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ObjectType) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ObjectType) #

gmapT :: (forall b. Data b => b -> b) -> ObjectType -> ObjectType #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ObjectType -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ObjectType -> r #

gmapQ :: (forall d. Data d => d -> u) -> ObjectType -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ObjectType -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ObjectType -> m ObjectType #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ObjectType -> m ObjectType #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ObjectType -> m ObjectType #

Show ObjectType # 

data ObjectPtr hash #

Delta objects points to some others objects in the database either as offset in the pack or as a direct reference.

Constructors

PtrRef (Ref hash) 
PtrOfs Word64 

Instances

Eq (ObjectPtr hash) # 

Methods

(==) :: ObjectPtr hash -> ObjectPtr hash -> Bool #

(/=) :: ObjectPtr hash -> ObjectPtr hash -> Bool #

Show (ObjectPtr hash) # 

Methods

showsPrec :: Int -> ObjectPtr hash -> ShowS #

show :: ObjectPtr hash -> String #

showList :: [ObjectPtr hash] -> ShowS #

data Object hash #

describe a git object, that could of 6 differents types: tree, blob, commit, tag and deltas (offset or ref). the deltas one are only available in packs.

Constructors

ObjCommit (Commit hash) 
ObjTag (Tag hash) 
ObjBlob (Blob hash) 
ObjTree (Tree hash) 
ObjDeltaOfs (DeltaOfs hash) 
ObjDeltaRef (DeltaRef hash) 

Instances

Eq (Object hash) # 

Methods

(==) :: Object hash -> Object hash -> Bool #

(/=) :: Object hash -> Object hash -> Bool #

Show (Object hash) # 

Methods

showsPrec :: Int -> Object hash -> ShowS #

show :: Object hash -> String #

showList :: [Object hash] -> ShowS #

data ObjectInfo hash #

Raw objects infos have an header (type, size, ptr), the data and a pointers chains to parents for resolved objects.

Constructors

ObjectInfo 

Fields

Instances

Eq (ObjectInfo hash) # 

Methods

(==) :: ObjectInfo hash -> ObjectInfo hash -> Bool #

(/=) :: ObjectInfo hash -> ObjectInfo hash -> Bool #

Show (ObjectInfo hash) # 

Methods

showsPrec :: Int -> ObjectInfo hash -> ShowS #

show :: ObjectInfo hash -> String #

showList :: [ObjectInfo hash] -> ShowS #

class Objectable a where #

Minimal complete definition

getType, getRaw, isDelta, toObject

Methods

getType :: a hash -> ObjectType #

getRaw :: a hash -> ByteString #

isDelta :: a hash -> Bool #

toObject :: a hash -> Object hash #

Instances

Objectable DeltaRef # 

Methods

getType :: DeltaRef hash -> ObjectType #

getRaw :: DeltaRef hash -> ByteString #

isDelta :: DeltaRef hash -> Bool #

toObject :: DeltaRef hash -> Object hash #

Objectable DeltaOfs # 

Methods

getType :: DeltaOfs hash -> ObjectType #

getRaw :: DeltaOfs hash -> ByteString #

isDelta :: DeltaOfs hash -> Bool #

toObject :: DeltaOfs hash -> Object hash #

Objectable Tag # 

Methods

getType :: Tag hash -> ObjectType #

getRaw :: Tag hash -> ByteString #

isDelta :: Tag hash -> Bool #

toObject :: Tag hash -> Object hash #

Objectable Commit # 

Methods

getType :: Commit hash -> ObjectType #

getRaw :: Commit hash -> ByteString #

isDelta :: Commit hash -> Bool #

toObject :: Commit hash -> Object hash #

Objectable Blob # 

Methods

getType :: Blob hash -> ObjectType #

getRaw :: Blob hash -> ByteString #

isDelta :: Blob hash -> Bool #

toObject :: Blob hash -> Object hash #

Objectable Tree # 

Methods

getType :: Tree hash -> ObjectType #

getRaw :: Tree hash -> ByteString #

isDelta :: Tree hash -> Bool #

toObject :: Tree hash -> Object hash #

objectToTree :: Object hash -> Maybe (Tree hash) #

objectToCommit :: Object hash -> Maybe (Commit hash) #

objectToTag :: Object hash -> Maybe (Tag hash) #

objectToBlob :: Object hash -> Maybe (Blob hash) #

parsing function

treeParse :: HashAlgorithm hash => Parser (Tree hash) #

parse a tree content

commitParse :: HashAlgorithm hash => Parser (Commit hash) #

parse a commit content

tagParse :: HashAlgorithm hash => Parser (Tag hash) #

parse a tag content

blobParse :: Parser (Blob hash) #

parse a blob content

objectParseTree :: HashAlgorithm hash => Parser (Object hash) #

objectParseCommit :: HashAlgorithm hash => Parser (Object hash) #

objectParseTag :: HashAlgorithm hash => Parser (Object hash) #

objectParseBlob :: HashAlgorithm hash => Parser (Object hash) #

writing function