From 154f48642dfdeff09472d462d6a5a069d0d9f4e9 Mon Sep 17 00:00:00 2001 From: Fabian Kirchner Date: Sat, 14 Oct 2023 00:46:19 +0200 Subject: deduce initial provenance from commit history --- app/Issue.hs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'app/Issue.hs') diff --git a/app/Issue.hs b/app/Issue.hs index fabd88f..847e014 100644 --- a/app/Issue.hs +++ b/app/Issue.hs @@ -54,20 +54,12 @@ id issue = fromMatch :: G.Result -> G.Match -> IO (Maybe Issue) fromMatch result match = do rawProvenance <- - fmap (map (T.splitOn "\NUL") . T.lines . decodeUtf8 . toStrict) $ + fmap (T.splitOn "\NUL" . head . T.lines . decodeUtf8 . toStrict) $ sh $ - ( fromString - ( printf - "git --no-pager log --reverse -S\"$(cat %s | tail -n+%d | head -%d)\" --format='%%H%%x00%%ai%%x00%%ae%%x00%%an' -- %s" - (quote result.file) - match.start.row - (match.end.row - match.start.row + 1) - (quote result.file) - ) - ) + "git show --format='%H%x00%ai%x00%ae%x00%an'" let provenance = case rawProvenance of - (firstCommit' : rawDate : authorEmail : authorName : _) : _ -> + firstCommit' : rawDate : authorEmail : authorName : _ -> let date = read (T.unpack rawDate) in Just Provenance -- cgit v1.2.3