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 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 getHistory :: IO ([Issue], [(CommitHash, [IssueEvent])]) getHistory = do commitInfos <- fromPartialCommitInfos <$> getPartialCommitInfos pure ((last commitInfos).issues, issueEvents commitInfos)