diff --git a/src/Vervis/Git.hs b/src/Vervis/Git.hs index 3cc4e7d..cb2f42b 100644 --- a/src/Vervis/Git.hs +++ b/src/Vervis/Git.hs @@ -63,6 +63,7 @@ data Server = Server , serverRepos :: HashMap (Either Int Int) [Repository] } +-- | Return the subdirs of a given dir subdirs :: FilePath -> IO [FilePath] subdirs dir = do _base :/ tree <- buildL dir @@ -73,6 +74,7 @@ subdirs dir = do in mapMaybe dirName cs _ -> [] +-- | Determine the time of the last commit in a given git branch lastBranchChange :: Git -> String -> IO GitTime lastBranchChange git branch = do mref <- resolveRevision git $ Revision branch [] @@ -80,6 +82,7 @@ lastBranchChange git branch = do let mtime = fmap (personTime . commitCommitter) (join mco) return $ fromMaybe (error "mtime is Nothing") mtime +-- | Determine the time of the last commit in any branch for a given repo lastChange :: FilePath -> IO DateTime lastChange path = withRepo (fromString path) $ \ git -> do --TODO add a better intro to json-state, the docs are bad there