hit-0.6.3: Git operations in haskell

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unix
Safe Haskell | None
Language | Haskell98

Data.Git.Types

Contents

- Type of types
- Main git types
- modeperm type
- time type
- Pack delta types
- Basic types part of other bigger types

Description

Synopsis

- data ObjectType
  - = TypeTree
  - | TypeBlob
  - | TypeCommit
  - | TypeTag
  - | TypeDeltaOff
  - | TypeDeltaRef
- data Tree = Tree {
  - treeGetEnts :: [TreeEnt]
  }
- data Commit = Commit {
  - commitTreeish :: Ref
  - commitParents :: [Ref]
  - commitAuthor :: Person
  - commitCommitter :: Person
  - commitEncoding :: Maybe ByteString
  - commitExtras :: [CommitExtra]
  - commitMessage :: ByteString
  }
- data CommitExtra = CommitExtra {
  - commitExtraKey :: ByteString
  - commitExtraValue :: ByteString
  }
- data Blob = Blob {
  - blobGetContent :: ByteString
  }
- data Tag = Tag {
  - tagRef :: Ref
  - tagObjectType :: ObjectType
  - tagBlob :: ByteString
  - tagName :: Person
  - tagS :: ByteString
  }
- data Person = Person {
  - personName :: ByteString
  - personEmail :: ByteString
  - personTime :: GitTime
  }
- data EntName
- entName :: ByteString -> EntName
- type EntPath = [EntName]
- entPathAppend :: EntPath -> EntName -> EntPath
- newtype ModePerm = ModePerm Word32
- data FilePermissions = FilePermissions {
  - getOwnerPerm :: !Perm
  - getGroupPerm :: !Perm
  - getOtherPerm :: !Perm
  }
- data ObjectFileType
  - = FileTypeDirectory
  - | FileTypeRegularFile
  - | FileTypeSymbolicLink
  - | FileTypeGitLink
- getPermission :: ModePerm -> FilePermissions
- getFiletype :: ModePerm -> ObjectFileType
- data GitTime = GitTime {
  - gitTimeUTC :: Elapsed
  - gitTimeTimezone :: TimezoneOffset
  }
- gitTime :: Integer -> Int -> GitTime
- gitTimeToLocal :: GitTime -> LocalTime Elapsed
- data DeltaOfs = DeltaOfs Word64 Delta
- data DeltaRef = DeltaRef Ref Delta
- type TreeEnt = (ModePerm, EntName, Ref)

# Type of types

data ObjectType Source #

type of a git object.

Constructors

TypeTree |
TypeBlob |
TypeCommit |
TypeTag |
TypeDeltaOff |
TypeDeltaRef |

Instances

Enum ObjectType Source # | the enum instance is useful when marshalling to pack file.
Methods succ :: ObjectType -> ObjectType # pred :: ObjectType -> ObjectType # toEnum :: Int -> ObjectType # fromEnum :: ObjectType -> Int # enumFrom :: ObjectType -> [ObjectType] # enumFromThen :: ObjectType -> ObjectType -> [ObjectType] # enumFromTo :: ObjectType -> ObjectType -> [ObjectType] # enumFromThenTo :: ObjectType -> ObjectType -> ObjectType -> [ObjectType] #
Eq ObjectType Source # |
Methods (==) :: ObjectType -> ObjectType -> Bool # (/=) :: ObjectType -> ObjectType -> Bool #
Data ObjectType Source # |

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 Source # |
Methods showsPrec :: Int -> ObjectType -> ShowS # show :: ObjectType -> String # showList :: [ObjectType] -> ShowS #

# Main git types

data Tree Source #

Represent a root tree with zero to many tree entries.

Constructors

Tree |

Fields

- treeGetEnts :: [TreeEnt]

Instances

Eq Tree Source # |
Methods (==) :: Tree -> Tree -> Bool # (/=) :: Tree -> Tree -> Bool #
Show Tree Source # |
Methods showsPrec :: Int -> Tree -> ShowS # show :: Tree -> String # showList :: [Tree] -> ShowS #
Monoid Tree Source # |
Methods mempty :: Tree # mappend :: Tree -> Tree -> Tree # mconcat :: [Tree] -> Tree #
Objectable Tree Source # |
Methods getType :: Tree -> ObjectType Source # getRaw :: Tree -> ByteString Source # isDelta :: Tree -> Bool Source # toObject :: Tree -> Object Source #

data Commit Source #

Represent a commit object.

Constructors

Commit |

Fields

- commitTreeish :: Ref
- commitParents :: [Ref]
- commitAuthor :: Person
- commitCommitter :: Person
- commitEncoding :: Maybe ByteString
- commitExtras :: [CommitExtra]
- commitMessage :: ByteString

Instances

Eq Commit Source # |
Methods (==) :: Commit -> Commit -> Bool # (/=) :: Commit -> Commit -> Bool #
Show Commit Source # |
Methods showsPrec :: Int -> Commit -> ShowS # show :: Commit -> String # showList :: [Commit] -> ShowS #
Objectable Commit Source # |
Methods getType :: Commit -> ObjectType Source # getRaw :: Commit -> ByteString Source # isDelta :: Commit -> Bool Source # toObject :: Commit -> Object Source #

data CommitExtra Source #

Constructors

CommitExtra |

Fields

- commitExtraKey :: ByteString
- commitExtraValue :: ByteString

Instances

Eq CommitExtra Source # |
Methods (==) :: CommitExtra -> CommitExtra -> Bool # (/=) :: CommitExtra -> CommitExtra -> Bool #
Show CommitExtra Source # |
Methods showsPrec :: Int -> CommitExtra -> ShowS # show :: CommitExtra -> String # showList :: [CommitExtra] -> ShowS #

data Blob Source #

Represent a binary blob.

Constructors

Blob |

Fields

- blobGetContent :: ByteString

Instances

Eq Blob Source # |
Methods (==) :: Blob -> Blob -> Bool # (/=) :: Blob -> Blob -> Bool #
Show Blob Source # |
Methods showsPrec :: Int -> Blob -> ShowS # show :: Blob -> String # showList :: [Blob] -> ShowS #
Objectable Blob Source # |
Methods getType :: Blob -> ObjectType Source # getRaw :: Blob -> ByteString Source # isDelta :: Blob -> Bool Source # toObject :: Blob -> Object Source #

data Tag Source #

Represent a signed tag.

Constructors

Tag |

Fields

- tagRef :: Ref
- tagObjectType :: ObjectType
- tagBlob :: ByteString
- tagName :: Person
- tagS :: ByteString

Instances

Eq Tag Source # |
Methods (==) :: Tag -> Tag -> Bool # (/=) :: Tag -> Tag -> Bool #
Show Tag Source # |
Methods showsPrec :: Int -> Tag -> ShowS # show :: Tag -> String # showList :: [Tag] -> ShowS #
Objectable Tag Source # |
Methods getType :: Tag -> ObjectType Source # getRaw :: Tag -> ByteString Source # isDelta :: Tag -> Bool Source # toObject :: Tag -> Object Source #

data Person Source #

an author or committer line has the format: name email time timezone FIXME: should be a string, but I don't know if the data is stored consistantly in one encoding (UTF8)

Constructors

Person |

Fields

- personName :: ByteString
- personEmail :: ByteString
- personTime :: GitTime

Instances

Eq Person Source # |
Methods (==) :: Person -> Person -> Bool # (/=) :: Person -> Person -> Bool #
Show Person Source # |
Methods showsPrec :: Int -> Person -> ShowS # show :: Person -> String # showList :: [Person] -> ShowS #

data EntName Source #

Entity name

Instances

Eq EntName Source # |
Methods (==) :: EntName -> EntName -> Bool # (/=) :: EntName -> EntName -> Bool #
Ord EntName Source # |
Methods compare :: EntName -> EntName -> Ordering # (<) :: EntName -> EntName -> Bool # (<=) :: EntName -> EntName -> Bool # (>) :: EntName -> EntName -> Bool # (>=) :: EntName -> EntName -> Bool # max :: EntName -> EntName -> EntName # min :: EntName -> EntName -> EntName #
Show EntName Source # |
Methods showsPrec :: Int -> EntName -> ShowS # show :: EntName -> String # showList :: [EntName] -> ShowS #
IsString EntName Source # |
Methods fromString :: String -> EntName #
Byteable EntName Source # |
Methods toBytes :: EntName -> ByteString # byteableLength :: EntName -> Int # withBytePtr :: EntName -> (Ptr Word8 -> IO b) -> IO b #

entName :: ByteString -> EntName Source #

type EntPath = [EntName] Source #

entPathAppend :: EntPath -> EntName -> EntPath Source #

# modeperm type

newtype ModePerm Source #

Constructors

ModePerm Word32 |

Instances

Eq ModePerm Source # |
Methods (==) :: ModePerm -> ModePerm -> Bool # (/=) :: ModePerm -> ModePerm -> Bool #
Show ModePerm Source # |
Methods showsPrec :: Int -> ModePerm -> ShowS # show :: ModePerm -> String # showList :: [ModePerm] -> ShowS #

data FilePermissions Source #

traditional unix permission for owner, group and permissions

Constructors

FilePermissions |

Fields

- getOwnerPerm :: !Perm
- getGroupPerm :: !Perm
- getOtherPerm :: !Perm

Instances

Eq FilePermissions Source # |
Methods (==) :: FilePermissions -> FilePermissions -> Bool # (/=) :: FilePermissions -> FilePermissions -> Bool #
Show FilePermissions Source # |
Methods showsPrec :: Int -> FilePermissions -> ShowS # show :: FilePermissions -> String # showList :: [FilePermissions] -> ShowS #

data ObjectFileType Source #

Git object file type

Constructors

FileTypeDirectory |
FileTypeRegularFile |
FileTypeSymbolicLink |
FileTypeGitLink |

Instances

Eq ObjectFileType Source # |
Methods (==) :: ObjectFileType -> ObjectFileType -> Bool # (/=) :: ObjectFileType -> ObjectFileType -> Bool #
Show ObjectFileType Source # |
Methods showsPrec :: Int -> ObjectFileType -> ShowS # show :: ObjectFileType -> String # showList :: [ObjectFileType] -> ShowS #

getPermission :: ModePerm -> FilePermissions Source #

getFiletype :: ModePerm -> ObjectFileType Source #

# time type

data GitTime Source #

Git time is number of seconds since unix epoch in the UTC zone with the current timezone associated

Constructors

GitTime |

Fields

- gitTimeUTC :: Elapsed
- gitTimeTimezone :: TimezoneOffset

Instances

Eq GitTime Source # |
Methods (==) :: GitTime -> GitTime -> Bool # (/=) :: GitTime -> GitTime -> Bool #
Show GitTime Source # |
Methods showsPrec :: Int -> GitTime -> ShowS # show :: GitTime -> String # showList :: [GitTime] -> ShowS #
Timeable GitTime Source # |
Methods timeGetElapsedP :: GitTime -> ElapsedP # timeGetElapsed :: GitTime -> Elapsed # timeGetNanoSeconds :: GitTime -> NanoSeconds #
Time GitTime Source # |
Methods timeFromElapsedP :: ElapsedP -> GitTime # timeFromElapsed :: Elapsed -> GitTime #

gitTime :: Integer -> Int -> GitTime Source #

gitTimeToLocal :: GitTime -> LocalTime Elapsed Source #

# Pack delta types

data DeltaOfs Source #

Delta pointing to an offset.

Constructors

DeltaOfs Word64 Delta |

Instances

Eq DeltaOfs Source # |
Methods (==) :: DeltaOfs -> DeltaOfs -> Bool # (/=) :: DeltaOfs -> DeltaOfs -> Bool #
Show DeltaOfs Source # |
Methods showsPrec :: Int -> DeltaOfs -> ShowS # show :: DeltaOfs -> String # showList :: [DeltaOfs] -> ShowS #
Objectable DeltaOfs Source # |
Methods getType :: DeltaOfs -> ObjectType Source # getRaw :: DeltaOfs -> ByteString Source # isDelta :: DeltaOfs -> Bool Source # toObject :: DeltaOfs -> Object Source #

data DeltaRef Source #

Delta pointing to a ref.

Constructors

DeltaRef Ref Delta |

Instances

Eq DeltaRef Source # |
Methods (==) :: DeltaRef -> DeltaRef -> Bool # (/=) :: DeltaRef -> DeltaRef -> Bool #
Show DeltaRef Source # |
Methods showsPrec :: Int -> DeltaRef -> ShowS # show :: DeltaRef -> String # showList :: [DeltaRef] -> ShowS #
Objectable DeltaRef Source # |
Methods getType :: DeltaRef -> ObjectType Source # getRaw :: DeltaRef -> ByteString Source # isDelta :: DeltaRef -> Bool Source # toObject :: DeltaRef -> Object Source #

# Basic types part of other bigger types

type TreeEnt = (ModePerm, EntName, Ref) Source #

represent one entry in the tree (permission,file or directory name,blob or tree ref) name should maybe a filepath, but not sure about the encoding.