diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-29 16:17:13 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-29 16:17:13 -0400 |
commit | 1e5aca5087e573aa93b4b6efe7c6f5abd90d0001 (patch) | |
tree | e54552bdc584b338d58003eb6015074cf89465c6 /Limit.hs | |
parent | 7d7b03e9ceab25efad67fc99e5b0813d210b1381 (diff) |
New annex.largefiles setting, which configures which files `git annex add` and the assistant add to the annex.
I would have sort of liked to put this in .gitattributes, but it seems
it does not support multi-word attribute values. Also, making this a single
config setting makes it easy to only parse the expression once.
A natural next step would be to make the assistant `git add` files that
are not annex.largefiles. OTOH, I don't think `git annex add` should
`git add` such files, because git-annex command line tools are
not in the business of wrapping git command line tools.
Diffstat (limited to 'Limit.hs')
-rw-r--r-- | Limit.hs | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -204,10 +204,15 @@ addSmallerThan = addLimit . limitSize (<) limitSize :: (Maybe Integer -> Maybe Integer -> Bool) -> MkLimit limitSize vs s = case readSize dataUnits s of Nothing -> Left "bad size" - Just sz -> Right $ const $ lookupFile >=> check sz + Just sz -> Right $ go sz where - check _ Nothing = return False - check sz (Just (key, _)) = return $ keySize key `vs` Just sz + go sz _ fi = lookupFile fi >>= check fi sz + check _ sz (Just (key, _)) = return $ keySize key `vs` Just sz + check fi sz Nothing = do + filesize <- liftIO $ catchMaybeIO $ + fromIntegral . fileSize + <$> getFileStatus (Annex.relFile fi) + return $ filesize `vs` Just sz addTimeLimit :: String -> Annex () addTimeLimit s = do |