From b6ce70689d563253eb31bb1853ad89c48fa3f686 Mon Sep 17 00:00:00 2001 From: voidlizard Date: Sat, 25 Jan 2025 11:00:29 +0300 Subject: [PATCH] wip --- hbs2-git3/app/GitRemoteHelper.hs | 2 +- hbs2-git3/lib/HBS2/Git3/Run.hs | 2 ++ hbs2-git3/lib/HBS2/Git3/State.hs | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hbs2-git3/app/GitRemoteHelper.hs b/hbs2-git3/app/GitRemoteHelper.hs index 6f319904..c423183e 100644 --- a/hbs2-git3/app/GitRemoteHelper.hs +++ b/hbs2-git3/app/GitRemoteHelper.hs @@ -83,7 +83,7 @@ localDict DeferredOps{..} = makeDict @C do rrefs <- importedRefs for_ rrefs $ \(r,h) -> do - debug $ pretty h <+> pretty r + notice $ yellow "REF" <+> pretty h <+> pretty r sendLine $ show $ pretty h <+> pretty r let l = lastMay rrefs diff --git a/hbs2-git3/lib/HBS2/Git3/Run.hs b/hbs2-git3/lib/HBS2/Git3/Run.hs index 4bf44aef..644e5095 100644 --- a/hbs2-git3/lib/HBS2/Git3/Run.hs +++ b/hbs2-git3/lib/HBS2/Git3/Run.hs @@ -433,11 +433,13 @@ compression ; prints compression level forM_ decoded print entry $ bindMatch "reflog:refs" $ nil_ $ \syn -> lift $ connectedDo do + waitRepo Nothing rrefs <- importedRefs for_ rrefs $ \(r,h) -> do liftIO $ print $ fill 20 (pretty h) <+> pretty r entry $ bindMatch "reflog:refs:raw" $ nil_ $ \syn -> lift $ connectedDo do + waitRepo Nothing refsFiles >>= readRefsRaw >>= liftIO . mapM_ (print . pretty) entry $ bindMatch "repo:wait" $ nil_ $ \syn -> lift $ connectedDo do diff --git a/hbs2-git3/lib/HBS2/Git3/State.hs b/hbs2-git3/lib/HBS2/Git3/State.hs index 2041e808..0ae400a1 100644 --- a/hbs2-git3/lib/HBS2/Git3/State.hs +++ b/hbs2-git3/lib/HBS2/Git3/State.hs @@ -60,7 +60,10 @@ updateRepoKey key = do reflog <- getRepoManifest <&> getRefLog ask >>= \case - Git3Connected{..} -> atomically $ writeTVar gitRefLog reflog + Git3Connected{..} -> do + notice $ yellow "UPDATED REFLOG" <+> pretty (fmap AsBase58 reflog) + atomically $ writeTVar gitRefLog reflog + _ -> none getRepoRefMaybe :: forall m . HBS2GitPerks m => Git3 m (Maybe (LWWRef 'HBS2Basic))