diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-11-06 15:39:51 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-11-06 15:39:51 -0400 |
commit | 7c7314ae73ce9b2a6059d80e7c356419ed40093c (patch) | |
tree | d9d8e3211cedc77847d17513413d1d7a9e36c890 | |
parent | 90d833e44240dd0a83fd2439fa1a23e490959235 (diff) |
work around git check-ignore --batch bad exit status bug, and bring back import -J
-rw-r--r-- | Command/Import.hs | 4 | ||||
-rw-r--r-- | Git/CheckIgnore.hs | 4 | ||||
-rw-r--r-- | doc/git-annex-import.mdwn | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/Command/Import.hs b/Command/Import.hs index 14216ab73..0dbf2e44a 100644 --- a/Command/Import.hs +++ b/Command/Import.hs @@ -21,7 +21,7 @@ import Annex.CheckIgnore 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) @@ -59,7 +59,7 @@ duplicateModeParser = ) 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 diff --git a/Git/CheckIgnore.hs b/Git/CheckIgnore.hs index 322088f89..7d30e5ada 100644 --- a/Git/CheckIgnore.hs +++ b/Git/CheckIgnore.hs @@ -57,8 +57,10 @@ supportedGitVersion = do v <- Git.Version.installed return $ v >= Git.Version.normalize "1.8.4" +{- For some reason, check-ignore --batch always exits nonzero, + - so ignore any error. -} checkIgnoreStop :: CheckIgnoreHandle -> IO () -checkIgnoreStop = CoProcess.stop +checkIgnoreStop = void . tryIO . CoProcess.stop {- Returns True if a file is ignored. -} checkIgnored :: CheckIgnoreHandle -> FilePath -> IO Bool diff --git a/doc/git-annex-import.mdwn b/doc/git-annex-import.mdwn index 48c087aec..ca37b81eb 100644 --- a/doc/git-annex-import.mdwn +++ b/doc/git-annex-import.mdwn @@ -66,6 +66,11 @@ Several options can be used to adjust handling of duplicate files. 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 |