module History ( getHistory, ) where import History.CommitHash (CommitHash) import History.CommitInfo (CommitInfo (..), fromPartialCommitInfos, issueEvents) import History.IssueEvent (IssueEvent (..)) import History.PartialCommitInfo (getPartialCommitInfos) import Issue (Issue) import Tuple () import Prelude hiding (id, lines) -- TODO Reduce cached data size -- -- Right now we are caching complete `Issue` instances, which -- contain the full issue title and description. For a fast -- lookup it may already be enough to only store the issue's -- -- \* filename -- \* start position -- \* end position -- -- With this information we can use git to quickly look up the -- complete issue text and parse it. -- -- @topic caching -- @backlog getHistory :: IO [(CommitHash, [IssueEvent], [Issue])] getHistory = do commitInfos <- fromPartialCommitInfos <$> getPartialCommitInfos let commitHashes = map (.hash) commitInfos issueses = map (.issues) commitInfos issueEventses <- map (._2) <$> issueEvents commitInfos pure (zip3 commitHashes issueEventses issueses)