diff options
author | Alexander Foremny <aforemny@posteo.de> | 2023-10-20 09:55:13 +0200 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2023-11-07 09:50:52 +0100 |
commit | eafbd88429a80f058efaa4efd28fbfb8271065c3 (patch) | |
tree | 35ae08955e34014fa6666bab26807a42fbbbbcee /app/Main.hs | |
parent | ea1236f2cf6d3ef4b739b2ca28f47a3bbed42295 (diff) |
record both creation and update in provenance
Diffstat (limited to 'app/Main.hs')
-rw-r--r-- | app/Main.hs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/app/Main.hs b/app/Main.hs index 3bb60e2..28a32bb 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -447,6 +447,7 @@ module Main where import Control.Applicative ((<|>)) import Data.Function ((&)) +import Issue.Provenance qualified as I import Data.List (find, isPrefixOf) import Data.Maybe (catMaybes) import Data.Text qualified as T @@ -610,13 +611,13 @@ main = do keyword "in" <+> value (T.pack issue.file <> ":" <> T.pack (show issue.start.row)) commit = fromProvenanceDef (keyword "via" <+> value (T.pack "HEAD")) $ - \I.Provenance {firstCommit} -> keyword "via" <+> value (T.take 7 firstCommit) + \I.Provenance {first} -> keyword "via" <+> value (T.take 7 first.hash) author = fromProvenance $ - \I.Provenance {authorName, authorEmail} -> - ( keyword "by" <+> value (authorName <> " <" <> authorEmail <> ">") + \I.Provenance {first} -> + ( keyword "by" <+> value (first.author.name <> " <" <> first.author.email <> ">") ) date' = fromProvenance $ - \I.Provenance {date} -> keyword "on" <+> value (show (utctDay date)) + \I.Provenance {first} -> keyword "on" <+> value (show (utctDay first.date)) fromProvenanceDef def = flip (maybe def) issue.provenance fromProvenance = flip fmap issue.provenance @@ -671,13 +672,13 @@ main = do "HEAD" Just provenance -> "\nvia " - ++ T.unpack provenance.firstCommit + ++ T.unpack provenance.first.hash ++ "\nby " - ++ T.unpack provenance.authorName + ++ T.unpack provenance.first.author.name ++ " <" - ++ T.unpack provenance.authorEmail + ++ T.unpack provenance.first.author.email ++ ">\nat " - ++ show provenance.date + ++ show provenance.first.date ) ++ "\n\n" sh_ |