diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-10-30 20:05:36 +0100 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-10-30 20:22:23 +0100 |
| commit | 5f497fe9e20cc414113f46b5b97a88e4cb77aef9 (patch) | |
| tree | b083fe04ecd0a73107e186e7098fdbc610e4c23a /src/Repo.hs | |
| parent | 09df29c85950e4908dbabeceb503ce3764f32561 (diff) | |
Last tag selection based on creation time
Diffstat (limited to 'src/Repo.hs')
| -rw-r--r-- | src/Repo.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Repo.hs b/src/Repo.hs index b6ad8d4..7fe699c 100644 --- a/src/Repo.hs +++ b/src/Repo.hs @@ -52,6 +52,8 @@ import Data.Maybe import Data.Text (Text) import Data.Text qualified as T import Data.Text.Encoding +import Data.Time.Format +import Data.Time.LocalTime import System.Environment import System.Exit @@ -118,6 +120,8 @@ data Tag a = Tag { tagTag :: Text , tagId :: TagId , tagObject :: a + , tagTagger :: Text + , tagTime :: ZonedTime , tagMessage :: Text } @@ -263,6 +267,11 @@ tryReadTag repo tag = do guard (otype == "commit") tagTag <- T.pack <$> lookup "tag" info cid <- CommitId . BC.pack <$> lookup "object" info + + tagger <- T.pack <$> lookup "tagger" info + let tagTagger = T.dropEnd 1 $ T.dropWhileEnd (/= ' ') $ T.dropEnd 1 $ T.dropWhileEnd (/= ' ') tagger + tagTime <- parseTimeM False defaultTimeLocale "%s %z" $ T.unpack $ T.drop (T.length tagTagger + 1) tagger + let tagMessage = T.pack $ unlines $ dropWhile null message Just $ do tagObject <- liftIO $ mkCommit repo cid |