From 225c2ff039137fcd3aa82343367f76d9d49f254c Mon Sep 17 00:00:00 2001 From: Fabian Kirchner Date: Sun, 15 Oct 2023 10:52:42 +0200 Subject: fix typo in issue and add caching issue --- app/History.hs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'app/History.hs') diff --git a/app/History.hs b/app/History.hs index 21709ae..5414927 100644 --- a/app/History.hs +++ b/app/History.hs @@ -37,6 +37,20 @@ listIssues filters paths = do [] -> pure [] hashFirst : hashesRest -> do + -- 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 issuesInitial <- cached (append hashFirst (pack ".all")) (\_ -> getIssuesCommitAll hashFirst) commitInfos <- mapM (\hash -> cached (append hash (pack ".changed")) (\_ -> getCommitInfo hash)) hashesRest commitInfoWorkingTree <- getCommitInfoWorkingTree paths @@ -83,7 +97,9 @@ issueFromIssueEvent issueEvent = Nothing data CommitInfo = CommitInfo - -- TODO Extact CommitInfo so we can change hash' -> hash + -- TODO Extract CommitInfo so we can change hash' -> hash + -- + -- @topic refactoring { hash' :: Maybe Text, filesChanged :: [FilePath], issues :: [Issue] -- cgit v1.2.3