From 32c76fb1f411896a4727ba2a76cdfc9dcd3dc48a Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Sun, 3 Dec 2023 13:29:00 +0100 Subject: feat: color patches --- app/History/CommitInfo.hs | 3 ++- app/History/IssueEvent.hs | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'app/History') diff --git a/app/History/CommitInfo.hs b/app/History/CommitInfo.hs index dbb7e20..c5224b2 100644 --- a/app/History/CommitInfo.hs +++ b/app/History/CommitInfo.hs @@ -20,6 +20,7 @@ import History.PartialCommitInfo (PartialCommitInfo (..)) import Issue (Issue (..)) import Issue.Provenance qualified as I import Parallel (parSequence) +import Patch qualified as P import Process (sh) import System.FilePath (()) import System.IO.Temp (withSystemTempDirectory) @@ -109,7 +110,7 @@ diffCommitInfos maybeOldInfo newInfo = let cwd = tmp T.writeFile (tmp "old") old T.writeFile (tmp "new") new - LT.toStrict . LT.decodeUtf8 <$> sh ("git diff --no-index -- old new || :" & setWorkingDir cwd) + P.parse . LT.toStrict . LT.decodeUtf8 <$> sh ("git diff --no-index -- old new || :" & setWorkingDir cwd) mergeListsBy :: (a -> a -> Bool) -> (a -> a -> b) -> (a -> b) -> (a -> b) -> [a] -> [a] -> [b] mergeListsBy eq onBoth onLeft onRight lefts rights = diff --git a/app/History/IssueEvent.hs b/app/History/IssueEvent.hs index 933b047..0900f13 100644 --- a/app/History/IssueEvent.hs +++ b/app/History/IssueEvent.hs @@ -1,24 +1,24 @@ module History.IssueEvent (IssueEvent (..)) where -import Data.Text qualified as T import History.CommitHash (CommitHash) import Issue (Issue) +import Patch (Patch) data IssueEvent = IssueCreated { hash :: CommitHash, issue :: Issue, - patch :: T.Text + patch :: Patch } | IssueChanged { hash :: CommitHash, oldIssue :: Issue, issue :: Issue, - patch :: T.Text + patch :: Patch } | IssueDeleted { hash :: CommitHash, issue :: Issue, - patch :: T.Text + patch :: Patch } deriving (Show) -- cgit v1.2.3