blob: 48dbbc7cebd399ec24c1157145eac01dcf1bac70 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
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
-- @backlog
getHistory :: IO ([Issue], [(CommitHash, [IssueEvent])])
getHistory = do
commitInfos <- fromPartialCommitInfos <$> getPartialCommitInfos
pure ((last commitInfos).issues, issueEvents commitInfos)
|