Safe Haskell | None |
---|---|
Language | Haskell2010 |
Pack file support.
Synopsis
- data PackObject
- data Raw = Raw {
- rawType :: !PackObject
- rawData :: !ByteString
- parsePackedRaw' :: Parser Raw
- base128le :: Parser Word
- parseCompactHeader :: Parser (PackObject, Word)
- decompressTo :: Word -> ByteString -> (ByteString, ByteString)
- type Patch a = RWST ByteString Builder Word64 Parser a
- parsePatch :: Patch ()
- applyPatch :: ByteString -> ByteString -> Either String ByteString
- resolveDelta :: Int -> PackFile -> Raw -> Maybe Raw
- parseFanout :: Parser (Vector Word32)
- parseIndexShas :: Word32 -> Parser (Vector Sha1)
- parseShaCrcs :: Word32 -> Parser (Vector Crc32)
- parseShaOffsets :: Word32 -> Parser (Vector Word32)
- parseBigOffsets :: Vector Word32 -> Parser (Vector Word64)
- parsePackIndex :: Parser PackIndex
- getShaOffset :: PackIndex -> Sha1 -> Maybe Word64
- readIndexFile :: RawFilePath -> IO PackIndex
- isPackIndex :: RawFilePath -> Bool
- readPackFile :: RawFilePath -> IO PackFile
- findPackSha :: PackFile -> Sha1 -> Maybe Object
- buildPackedObject :: Object -> Builder
- compactTag :: Object -> Word8
- buildCompactHeader :: Word8 -> Word64 -> Builder
- data IndexData = IndexData {}
- type PackIndexer = Map Sha1 IndexData
- data PackingState = PackingState {}
- makePackIndex :: PackIndexer -> PackIndex
- buildPackIndex :: PackIndex -> Builder
- newtype PackingT m a = PackingT {
- unPackingT :: ReaderT (MVar PackingState) m a
- runPackingT :: MonadIO m => (PackFile -> m ()) -> RawFilePath -> PackingT m a -> m a
- flushPackFile :: MonadIO m => (PackFile -> m ()) -> PackingT m ()
- packObject :: MonadIO m => Object -> PackingT m Sha1
- writePackFile :: MonadIO m => (PackFile -> m ()) -> RawFilePath -> [Object] -> m ()
- finishPackFile :: MonadIO m => PackingState -> m (Maybe PackFile)
- newPackFile :: RawFilePath -> IO PackingState
Documentation
data PackObject Source #
Instances
Eq PackObject Source # | |
Defined in Data.Git.Internal.Pack (==) :: PackObject -> PackObject -> Bool # (/=) :: PackObject -> PackObject -> Bool # | |
Ord PackObject Source # | |
Defined in Data.Git.Internal.Pack compare :: PackObject -> PackObject -> Ordering # (<) :: PackObject -> PackObject -> Bool # (<=) :: PackObject -> PackObject -> Bool # (>) :: PackObject -> PackObject -> Bool # (>=) :: PackObject -> PackObject -> Bool # max :: PackObject -> PackObject -> PackObject # min :: PackObject -> PackObject -> PackObject # | |
Show PackObject Source # | |
Defined in Data.Git.Internal.Pack showsPrec :: Int -> PackObject -> ShowS # show :: PackObject -> String # showList :: [PackObject] -> ShowS # |
Raw | |
|
parsePackedRaw' :: Parser Raw Source #
parseCompactHeader :: Parser (PackObject, Word) Source #
decompressTo :: Word -> ByteString -> (ByteString, ByteString) Source #
parsePatch :: Patch () Source #
applyPatch :: ByteString -> ByteString -> Either String ByteString Source #
parseFanout :: Parser (Vector Word32) Source #
parseIndexShas :: Word32 -> Parser (Vector Sha1) Source #
parseShaCrcs :: Word32 -> Parser (Vector Crc32) Source #
parseShaOffsets :: Word32 -> Parser (Vector Word32) Source #
parseBigOffsets :: Vector Word32 -> Parser (Vector Word64) Source #
parsePackIndex :: Parser PackIndex Source #
readIndexFile :: RawFilePath -> IO PackIndex Source #
isPackIndex :: RawFilePath -> Bool Source #
readPackFile :: RawFilePath -> IO PackFile Source #
Read a PackFile
off the filesystem.
buildPackedObject :: Object -> Builder Source #
compactTag :: Object -> Word8 Source #
data PackingState Source #
PackingState | |
|
Instances
Monad m => MonadReader (MVar PackingState) (PackingT m) Source # | |
Defined in Data.Git.Internal.Pack ask :: PackingT m (MVar PackingState) # local :: (MVar PackingState -> MVar PackingState) -> PackingT m a -> PackingT m a # reader :: (MVar PackingState -> a) -> PackingT m a # |
makePackIndex :: PackIndexer -> PackIndex Source #
buildPackIndex :: PackIndex -> Builder Source #
A monad transformer for writing packfiles.
PackingT | |
|
Instances
runPackingT :: MonadIO m => (PackFile -> m ()) -> RawFilePath -> PackingT m a -> m a Source #
Run a PackingT
computation, using the given path as a template for the tempfile. The pack
and the index will be written to the same directory as the tempfile.
flushPackFile :: MonadIO m => (PackFile -> m ()) -> PackingT m () Source #
Write out the currently accumulating packfile, and start writing a new one.
writePackFile :: MonadIO m => (PackFile -> m ()) -> RawFilePath -> [Object] -> m () Source #
Write the given objects to a packfile using the given path as a template for the tempfile. The pack will be written to the same directory as the tempfile. Also writes the pack index.
finishPackFile :: MonadIO m => PackingState -> m (Maybe PackFile) Source #
newPackFile :: RawFilePath -> IO PackingState Source #