import Control.Exception (IOException)
cmd :: Command
-cmd = notBareRepo $ withGlobalOptions fileMatchingOptions $
+cmd = notBareRepo $ withGlobalOptions (jobsOption : fileMatchingOptions) $
command "add" SectionCommon "add files to annex"
paramPaths (seek <$$> optParser)
-
- In direct mode, it acts on any files that have changed. -}
seek :: AddOptions -> CommandSeek
-seek o = do
+seek o = allowConcurrentOutput $ do
matcher <- largeFilesMatcher
let go a = flip a (addThese o) $ \file -> ifM (checkFileMatcher matcher file <||> Annex.getState Annex.force)
( start file
#endif
cmd :: Command
-cmd = notBareRepo $
+cmd = notBareRepo $ withGlobalOptions [jobsOption] $
command "addurl" SectionCommon "add urls to annex"
(paramRepeating paramUrl) (seek <$$> optParser)
)
seek :: AddUrlOptions -> CommandSeek
-seek o = forM_ (addUrls o) $ \u -> do
- r <- Remote.claimingUrl u
- if Remote.uuid r == webUUID || rawOption o
- then void $ commandAction $ startWeb o u
- else checkUrl r o u
+seek o = allowConcurrentOutput $
+ forM_ (addUrls o) $ \u -> do
+ r <- Remote.claimingUrl u
+ if Remote.uuid r == webUUID || rawOption o
+ then void $ commandAction $ startWeb o u
+ else checkUrl r o u
checkUrl :: Remote -> AddUrlOptions -> URLString -> Annex ()
checkUrl r o u = do
import Annex.NumCopies
cmd :: Command
-cmd = withGlobalOptions fileMatchingOptions $ notBareRepo $
+cmd = withGlobalOptions (jobsOption : fileMatchingOptions) $ notBareRepo $
command "import" SectionCommon
"move and add files from outside git working copy"
paramPaths (seek <$$> optParser)
)
seek :: ImportOptions -> CommandSeek
-seek o = do
+seek o = allowConcurrentOutput $ do
repopath <- liftIO . absPath =<< fromRepo Git.repoPath
inrepops <- liftIO $ filter (dirContains repopath) <$> mapM absPath (importFiles o)
unless (null inrepops) $ do
* Use concurrent-output library when configured with -fConcurrentOutput.
This allows nicely displayed messages when using the -J flag.
- * Additional commands now suppport the -J flag: fsck, drop
+ * Additional commands now suppport the -J flag:
+ fsck, drop, add, addurl, import
-- Joey Hess <id@joeyh.name> Wed, 04 Nov 2015 12:50:20 -0400
For example: `--largerthan=1GB`
+* `--jobs=N` `-JN`
+
+ Adds multiple files in parallel. This may be faster.
+ For example: `-J4`
+
# SEE ALSO
[[git-annex]](1)
Use to adjust the filenames that are created by addurl. For example,
`--suffix=.mp3` can be used to add an extension to the file.
+* `--jobs=N` `-JN`
+
+ Enables parallel downloads when multiple urls are being added.
+ For example: `-J4`
+
# SEE ALSO
[[git-annex]](1)
git annex import /dir --include='*.png'
+* `--jobs=N` `-JN`
+
+ Imports multiple files in parallel. This may be faster.
+ For example: `-J4`
+
# CAVEATS
Note that using `--deduplicate` or `--clean-duplicates` with the WORM