diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2024-12-21 13:10:41 +0100 | 
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-12-21 13:10:41 +0100 | 
| commit | 03c781c1a60759622e772ac7fb6a167111ed0bea (patch) | |
| tree | 5208aec6c1c2e4fc24e962d85006811c414bab90 /src/Command | |
| parent | 30432ddadb796638b6ca8ee354e31b7c95daff58 (diff) | |
Repo module to abstract git access
Diffstat (limited to 'src/Command')
| -rw-r--r-- | src/Command/Run.hs | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/src/Command/Run.hs b/src/Command/Run.hs index daba8af..729a699 100644 --- a/src/Command/Run.hs +++ b/src/Command/Run.hs @@ -19,6 +19,7 @@ import System.Process  import Command  import Config  import Job +import Repo  data RunCommand = RunCommand Text @@ -55,18 +56,18 @@ cmdRun (RunCommand changeset) = do          [] -> error "splitOn should not return empty list"      liftIO $ do -        commits <- map (fmap (drop 1) . (span (/=' '))) . lines <$> -            readProcess "git" [ "log", "--pretty=oneline", "--first-parent", "--reverse", base <> ".." <> tip ] "" +        Just repo <- openRepo "." +        commits <- listCommits repo (base <> ".." <> tip)          putStr $ replicate (8 + 50) ' '          forM_ (configJobs config) $ \job -> do              T.putStr $ (" "<>) $ fitToLength 7 $ textJobName $ jobName job          putStrLn "" -        forM_ commits $ \(cid, desc) -> do -            let shortCid = T.pack $ take 7 cid -            outs <- runJobs "./.minici" cid $ configJobs config -            displayStatusLine shortCid (" " <> fitToLength 50 (T.pack desc)) outs +        forM_ commits $ \commit -> do +            let shortCid = T.pack $ take 7 $ showCommitId $ commitId commit +            outs <- runJobs "./.minici" commit $ configJobs config +            displayStatusLine shortCid (" " <> fitToLength 50 (commitDescription commit)) outs  fitToLength :: Int -> Text -> Text |