diff options
author | Fabian Kirchner <kirchner@posteo.de> | 2023-10-14 00:46:19 +0200 |
---|---|---|
committer | Fabian Kirchner <kirchner@posteo.de> | 2023-10-14 00:46:19 +0200 |
commit | 154f48642dfdeff09472d462d6a5a069d0d9f4e9 (patch) | |
tree | 006ebd9e4b25073537c91f8f2c315e44ca9b5b63 /app/Issue.hs | |
parent | 3f8d07cbbbd31ba9850208af58039024f31d56b9 (diff) |
deduce initial provenance from commit history
Diffstat (limited to 'app/Issue.hs')
-rw-r--r-- | app/Issue.hs | 14 |
1 files changed, 3 insertions, 11 deletions
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 |