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.Ref

Contents

- Exceptions
- convert from bytestring and string
- Misc function related to ref
- Hash ByteString types to a ref

Description

Synopsis

- data Ref
- data RefInvalid = RefInvalid ByteString
- data RefNotFound = RefNotFound Ref
- isHex :: ByteString -> Bool
- isHexString :: [Char] -> Bool
- fromHex :: ByteString -> Ref
- fromHexString :: String -> Ref
- fromBinary :: ByteString -> Ref
- toBinary :: Ref -> ByteString
- toHex :: Ref -> ByteString
- toHexString :: Ref -> String
- refPrefix :: Ref -> Int
- cmpPrefix :: String -> Ref -> Ordering
- toFilePathParts :: Ref -> (String, String)
- hash :: ByteString -> Ref
- hashLBS :: ByteString -> Ref

# Documentation

data Ref Source

represent a git reference (SHA1)

Instances

Eq Ref Source |
Data Ref Source |
Ord Ref Source |
Show Ref Source |

# Exceptions

data RefInvalid Source

Invalid Reference exception raised when using something that is not a ref as a ref.

Constructors

RefInvalid ByteString |

Instances

Eq RefInvalid Source |
Data RefInvalid Source |
Show RefInvalid Source |
Exception RefInvalid Source |

data RefNotFound Source

Reference wasn't found

Constructors

RefNotFound Ref |

Instances

Eq RefNotFound Source |
Data RefNotFound Source |
Show RefNotFound Source |
Exception RefNotFound Source |

# convert from bytestring and string

isHex :: ByteString -> Bool Source

isHexString :: [Char] -> Bool Source

fromHex :: ByteString -> Ref Source

take a hexadecimal bytestring that represent a reference and turn into a ref

fromHexString :: String -> Ref Source

take a hexadecimal string that represent a reference and turn into a ref

fromBinary :: ByteString -> Ref Source

transform a bytestring that represent a binary bytestring and returns a ref.

toBinary :: Ref -> ByteString Source

turn a reference into a binary bytestring

toHex :: Ref -> ByteString Source

transform a ref into an hexadecimal bytestring

toHexString :: Ref -> String Source

transform a ref into an hexadecimal string

# Misc function related to ref

refPrefix :: Ref -> Int Source

returns the prefix (leading byte) of this reference

cmpPrefix :: String -> Ref -> Ordering Source

compare prefix

toFilePathParts :: Ref -> (String, String) Source

returns the splitted format "prefix/suffix" for addressing the loose object database

# Hash ByteString types to a ref

hash :: ByteString -> Ref Source

hash a bytestring into a reference

hashLBS :: ByteString -> Ref Source

hash a lazy bytestring into a reference