diff options
Diffstat (limited to 'app/History.hs')
-rw-r--r-- | app/History.hs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/app/History.hs b/app/History.hs index fee1f2e..36dc1fc 100644 --- a/app/History.hs +++ b/app/History.hs @@ -1,4 +1,10 @@ -module History (getIssues, listIssues) where +module History + ( getIssues, + listIssues, + listEvents, + IssueEvent (..), + ) +where import Control.Exception (Exception, catch, handle, throw) import Data.Aeson (eitherDecode) @@ -28,6 +34,18 @@ import TreeGrepper.Result qualified as G import Prelude hiding (id, lines) import Prelude qualified as Prelude +listEvents :: IO [[IssueEvent]] +listEvents = do + commitHashes <- fmap reverse getCommitHashes + case commitHashes of + [] -> pure [] + hashFirst : hashesRest -> do + issuesInitial <- cached (append hashFirst (pack ".all")) (\_ -> getIssuesCommitAll hashFirst) + commitInfos <- mapM (\hash -> cached (append hash (pack ".changed")) (\_ -> getCommitInfo hash)) hashesRest + commitInfoWorkingTree <- getCommitInfoWorkingTree [] + let eventses = getEvents hashFirst issuesInitial (commitInfos ++ [commitInfoWorkingTree]) + pure eventses + listIssues :: [Sort] -> [Filter] -> [FilePath] -> IO [Issue] listIssues sort filters paths = do commitHashes <- fmap reverse getCommitHashes |