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 #

type of a git object.

Constructors

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

Instances

Enum ObjectType # | 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 # |
Methods (==) :: ObjectType -> ObjectType -> Bool # (/=) :: ObjectType -> ObjectType -> Bool #
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 # |
Methods showsPrec :: Int -> ObjectType -> ShowS # show :: ObjectType -> String # showList :: [ObjectType] -> ShowS #

# Main git types

data Tree #

Represent a root tree with zero to many tree entries.

Constructors

Tree |
Fields treeGetEnts :: [TreeEnt]

Instances

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

data Commit #

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

data CommitExtra #

Constructors

CommitExtra |
Fields commitExtraKey :: ByteString commitExtraValue :: ByteString

Instances

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

data Blob #

Represent a binary blob.

Constructors

Blob |
Fields blobGetContent :: ByteString

Instances

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

data Tag #

Represent a signed tag.

Constructors

Tag |
Fields tagRef :: Ref tagObjectType :: ObjectType tagBlob :: ByteString tagName :: Person tagS :: ByteString

Instances

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

data Person #

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 # |
Methods (==) :: Person -> Person -> Bool # (/=) :: Person -> Person -> Bool #
Show Person # |
Methods showsPrec :: Int -> Person -> ShowS # show :: Person -> String # showList :: [Person] -> ShowS #

data EntName #

Entity name

Instances

Eq EntName # |
Methods (==) :: EntName -> EntName -> Bool # (/=) :: EntName -> EntName -> Bool #
Ord EntName # |
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 # |
Methods showsPrec :: Int -> EntName -> ShowS # show :: EntName -> String # showList :: [EntName] -> ShowS #
IsString EntName # |
Methods fromString :: String -> EntName #
Byteable EntName # |
Methods toBytes :: EntName -> ByteString # byteableLength :: EntName -> Int # withBytePtr :: EntName -> (Ptr Word8 -> IO b) -> IO b #

entName :: ByteString -> EntName #

type EntPath = [EntName] #

entPathAppend :: EntPath -> EntName -> EntPath #

# modeperm type

newtype ModePerm #

Constructors

ModePerm Word32 |

Instances

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

data FilePermissions #

traditional unix permission for owner, group and permissions

Constructors

FilePermissions |
Fields getOwnerPerm :: !Perm getGroupPerm :: !Perm getOtherPerm :: !Perm

Instances

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

data ObjectFileType #

Git object file type

Constructors

FileTypeDirectory |
FileTypeRegularFile |
FileTypeSymbolicLink |
FileTypeGitLink |

Instances

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

getPermission :: ModePerm -> FilePermissions #

getFiletype :: ModePerm -> ObjectFileType #

# time type

data GitTime #

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

gitTime :: Integer -> Int -> GitTime #

gitTimeToLocal :: GitTime -> LocalTime Elapsed #

# Pack delta types

data DeltaOfs #

Delta pointing to an offset.

Constructors

DeltaOfs Word64 Delta |

Instances

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

data DeltaRef #

Delta pointing to a ref.

Constructors

DeltaRef Ref Delta |

Instances

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

# Basic types part of other bigger types

type TreeEnt = (ModePerm, EntName, Ref) #

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.