aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2023-11-30 03:21:59 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2023-11-30 03:22:02 +0100
commitff5535f0a55201c6883c48c3892c9ef357904356 (patch)
tree0f62dc42c15d2c90bbdb759435c56a1a75e87651
parent91e188fbb70c20b939c221a95123934358d1c6c5 (diff)
feat: show commit references in show command
-rw-r--r--app/Issue/Meta.hs2
-rw-r--r--app/Main.hs26
2 files changed, 14 insertions, 14 deletions
diff --git a/app/Issue/Meta.hs b/app/Issue/Meta.hs
index d9851ec..4c237a4 100644
--- a/app/Issue/Meta.hs
+++ b/app/Issue/Meta.hs
@@ -21,7 +21,7 @@ getMeta issues issue =
( \issueOther ->
let tagsRelevant =
filter (\tag -> tagValue tag == fmap T.pack issue.id) issueOther.tags
- in map (\tag -> (issue, tag)) tagsRelevant
+ in map (\tag -> (issueOther, tag)) tagsRelevant
)
issues
}
diff --git a/app/Main.hs b/app/Main.hs
index a16ee7e..06327c4 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -235,19 +235,6 @@
-- @topic dependencies
-- @backlog
--- TODO Relations between issues
---
--- Issues should be able to refer to other issues (via id) within their tags,
--- ie. `@supersedes target-issue-id`. Such relations should create issue
--- events on the target issue, and recording the source issue id that created
--- the relation.
---
--- This might serve as ground work for dependencies-between-issues.
---
--- @related dependencies-between-issues
--- @priority high
--- @assigned Alexander Foremny
-
-- TODO Add fulltext search
--
-- Additional to `--filter` it should be possible to search for issues
@@ -384,6 +371,7 @@
module Main where
import Control.Applicative ((<|>))
+import Control.Monad (when)
import Data.Function ((&))
import Data.List (find, intersperse, isPrefixOf)
import Data.List.Extra (list)
@@ -702,6 +690,18 @@ main = do
++ "\n@row "
++ show issue.start.row
++ "\n"
+ when (not $ null meta.referencedBy) $
+ putDoc colorize True width . P.annotate (P.color P.Black) . P.vsep $
+ P.pretty ("" :: T.Text)
+ : map
+ ( \(otherIssue, tag) ->
+ P.pretty ("This commit was referenced by issue " :: T.Text)
+ <> P.annotate P.bold (P.pretty otherIssue.id)
+ <> P.pretty (" (" :: T.Text)
+ <> P.annotate P.bold (P.pretty ("@" <> I.tagKey tag))
+ <> P.pretty (")." :: T.Text)
+ )
+ meta.referencedBy
Options {colorize, noPager, width, internalTags, command = Tags} -> do
issues <- trd3 . last <$> getHistory
let tags =