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.
Eq ObjectType Source |
Data ObjectType Source |
Show ObjectType Source |

# 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 |
Show Tree Source |
Monoid Tree Source |
Objectable Tree 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 |
Show Commit Source |
Objectable Commit Source |

data CommitExtra Source

Constructors

CommitExtra |

Fields

commitExtraKey :: ByteString
commitExtraValue :: ByteString

Instances

Eq CommitExtra Source |
Show CommitExtra Source |

data Blob Source

Represent a binary blob.

Constructors

Blob |

Fields

blobGetContent :: ByteString

Instances

Eq Blob Source |
Show Blob Source |
Objectable Blob 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 |
Show Tag Source |
Objectable Tag 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 |
Show Person Source |

data EntName Source

Entity name

Instances

Eq EntName Source |
Ord EntName Source |
Show EntName Source |
IsString EntName Source |
Byteable EntName Source |

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 |
Show ModePerm Source |

data FilePermissions Source

traditional unix permission for owner, group and permissions

Constructors

FilePermissions |

Fields

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

Instances

Eq FilePermissions Source |
Show FilePermissions Source |

data ObjectFileType Source

Git object file type

Constructors

FileTypeDirectory |
FileTypeRegularFile |
FileTypeSymbolicLink |
FileTypeGitLink |

Instances

Eq ObjectFileType Source |
Show ObjectFileType Source |

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 |
Show GitTime Source |
Timeable GitTime Source |
Time GitTime Source |

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 |
Show DeltaOfs Source |
Objectable DeltaOfs Source |

data DeltaRef Source

Delta pointing to a ref.

Constructors

DeltaRef Ref Delta |

Instances

Eq DeltaRef Source |
Show DeltaRef Source |
Objectable DeltaRef 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.