aboutsummaryrefslogtreecommitdiffstats
path: root/app/History
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2023-10-20 09:55:53 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2023-11-07 09:50:52 +0100
commitf849fe4f8bd424a57de870d6cb8f038221dd7ff2 (patch)
treedb1c7744d2bc3e8577e0cdce6031625d684894f5 /app/History
parenteafbd88429a80f058efaa4efd28fbfb8271065c3 (diff)
add internal tag @modifiedAt
Diffstat (limited to 'app/History')
-rw-r--r--app/History/CommitInfo.hs45
1 files changed, 25 insertions, 20 deletions
diff --git a/app/History/CommitInfo.hs b/app/History/CommitInfo.hs
index b42e1ba..5285e68 100644
--- a/app/History/CommitInfo.hs
+++ b/app/History/CommitInfo.hs
@@ -46,14 +46,18 @@ fromPartialCommitInfos (partialCommitInfo : partialCommitInfos) =
Just
new
{ provenance =
- (\oldProvenance newProvenance ->
- ( I.Provenance
- { first = oldProvenance.first,
- last = newProvenance.last
- }
- )
+ ( \oldProvenance newProvenance ->
+ ( I.Provenance
+ { first = oldProvenance.first,
+ last =
+ if clear old /= clear new
+ then newProvenance.last
+ else oldProvenance.last
+ }
+ )
)
- <$> old.provenance <*> new.provenance,
+ <$> old.provenance
+ <*> new.provenance,
internalTags = I.internalTags new.title old.provenance
}
)
@@ -91,21 +95,22 @@ diffCommitInfos oldInfo newInfo =
newIssues = newInfo.issues
oldIssues = oldInfo.issues
- -- TODO Fix issue comparison
- --
- -- Because issues carry `provenance` and `internalTags`, issues compare
- -- unequally when we want them to be equal.
- clear i =
- i
- { provenance = Nothing,
- internalTags = [],
- start = Position 0 0,
- end = Position 0 0,
- file = ""
- }
-
eq = (==) `on` id
+-- TODO Fix issue comparison
+--
+-- Because issues carry `provenance` and `internalTags`, issues compare
+-- unequally when we want them to be equal.
+clear :: Issue -> Issue
+clear i =
+ i
+ { provenance = Nothing,
+ internalTags = [],
+ start = Position 0 0,
+ end = Position 0 0,
+ file = ""
+ }
+
mergeListsBy :: (a -> a -> Bool) -> (a -> a -> b) -> (a -> b) -> (a -> b) -> [a] -> [a] -> [b]
mergeListsBy eq onBoth onLeft onRight lefts rights =
concat