From ff5535f0a55201c6883c48c3892c9ef357904356 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Thu, 30 Nov 2023 03:21:59 +0100 Subject: feat: show commit references in show command --- app/Main.hs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'app/Main.hs') 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 = -- cgit v1.2.3