aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Fabian Kirchner <kirchner@posteo.de>2023-10-15 10:52:42 +0200
committerLibravatar Fabian Kirchner <kirchner@posteo.de>2023-10-15 10:52:42 +0200
commit225c2ff039137fcd3aa82343367f76d9d49f254c (patch)
tree48077604dc9a4f75e85992aac676f29da071a2c9
parent7c4995d1508efc17791995c546fac8ea3039bc1b (diff)
fix typo in issue and add caching issue
-rw-r--r--app/History.hs18
-rw-r--r--app/Main.hs2
2 files changed, 18 insertions, 2 deletions
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]
diff --git a/app/Main.hs b/app/Main.hs
index 45aaa22..b535335 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -235,7 +235,7 @@
--
-- @topic options
--- FIXME anissue crashes when displaying unicode emojis
+-- FIXME Crash when displaying some unicode emojis
--
-- Running `anissue show tool-crashes-when-displaying-unicode-emojis`
-- will crash because of 🏗️.