From cb3752da6388fe625c3425350b84a0394600c178 Mon Sep 17 00:00:00 2001 From: voidlizard Date: Sun, 12 Jan 2025 16:57:08 +0300 Subject: [PATCH] wip, git:list:objects to display hashes --- hbs2-git3/app/Main.hs | 10 ++++++---- hbs2-git3/lib/HBS2/Git3/State/Index.hs | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hbs2-git3/app/Main.hs b/hbs2-git3/app/Main.hs index 8d2817b8..63894dbb 100644 --- a/hbs2-git3/app/Main.hs +++ b/hbs2-git3/app/Main.hs @@ -956,7 +956,7 @@ theDict = do idxPath <- getStatePath (AsBase58 reflog) <&> ( "index") mkdir idxPath - notice $ "STATE" <+> pretty idxPath + debug $ "STATE" <+> pretty idxPath sink <- S.toList_ do walkMerkle (coerce what) (getBlock sto) $ \case @@ -1091,7 +1091,7 @@ theDict = do (t1,r) <- timeItT (lift $ readCommitChainHPSQ req Nothing h0 dontHandle) let s = HPSQ.size r - notice $ pretty s <+> "new commits read at" <+> pretty (realToFrac @_ @(Fixed E3) t1) + debug $ pretty s <+> "new commits read at" <+> pretty (realToFrac @_ @(Fixed E3) t1) cap <- liftIO getNumCapabilities gitCatBatchQ <- contWorkerPool cap do @@ -1112,11 +1112,13 @@ theDict = do <&> ([commit,tree]<>) >>= \hs -> atomically (for_ hs (modifyTVar uniq_ . HS.insert)) - notice $ "all shit read" <+> pretty (realToFrac @_ @(Fixed E2) t3) + debug $ "read new objects" <+> pretty (realToFrac @_ @(Fixed E2) t3) (t4,new) <- lift $ timeItT $ readTVarIO uniq_ >>= indexFilterNewObjects idx - notice $ pretty (length new) <+> "new objects" <+> "at" <+> pretty (realToFrac @_ @(Fixed E2) t4) + liftIO $ for_ new $ \n -> do + print $ pretty n + -- notice $ pretty (length new) <+> "new objects" <+> "at" <+> pretty (realToFrac @_ @(Fixed E2) t4) entry $ bindMatch "reflog:tx:list" $ nil_ $ \syn -> lift $ connectedDo do diff --git a/hbs2-git3/lib/HBS2/Git3/State/Index.hs b/hbs2-git3/lib/HBS2/Git3/State/Index.hs index d297a019..69ed37d6 100644 --- a/hbs2-git3/lib/HBS2/Git3/State/Index.hs +++ b/hbs2-git3/lib/HBS2/Git3/State/Index.hs @@ -314,7 +314,7 @@ updateReflogIndex = do atomically $ modifyTVar written_ (HS.insert txh) written <- readTVarIO written_ - notice $ "read index at" <+> pretty (realToFrac @_ @(Fixed E2) t1) + debug $ "read index at" <+> pretty (realToFrac @_ @(Fixed E2) t1) flip runContT pure do @@ -326,7 +326,7 @@ updateReflogIndex = do idxPath <- lift indexPath mkdir idxPath - notice $ "STATE" <+> pretty idxPath + debug $ "STATE" <+> pretty idxPath sink <- S.toList_ do walkMerkle (coerce what) (getBlock sto) $ \case