diff --git a/hbs21-git/git-hbs21/Main.hs b/hbs21-git/git-hbs21/Main.hs index 03d3b6ba..fc6bc349 100644 --- a/hbs21-git/git-hbs21/Main.hs +++ b/hbs21-git/git-hbs21/Main.hs @@ -99,6 +99,7 @@ pImport = do pTools :: GitPerks m => Parser (GitCLI m ()) pTools = hsubparser ( command "dump-pack" (info pDumpPack (progDesc "dump hbs2 git pack")) <> command "show-ref" (info pShowRef (progDesc "show current references")) + <> command "show-remotes" (info pShowLww (progDesc "show current remotes (hbs2 references)")) ) @@ -135,6 +136,13 @@ pDumpPack = do ( long "pack" ) +pShowLww :: GitPerks m => Parser (GitCLI m ()) +pShowLww = pure do + items <- withState selectAllLww + liftIO $ print $ vcat (fmap fmt items) + where + fmt (l,n,k) = fill 4 (pretty n) <+> fill 32 (pretty l) <+> fill 32 (pretty (AsBase58 k)) + pShowRef :: GitPerks m => Parser (GitCLI m ()) pShowRef = do pure do diff --git a/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/State.hs b/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/State.hs index 5974090d..502980c3 100644 --- a/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/State.hs +++ b/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/State.hs @@ -170,7 +170,7 @@ createLwwTable = do ddl [qc| create table if not exists lww ( hash text not null - , seq text not null + , seq int not null , reflog text not null , primary key (hash,seq,reflog) )