dropunused: Support --jobs

Sponsored-by: Kevin Mueller on Patreon
This commit is contained in:
Joey Hess 2023-07-21 14:03:34 -04:00
parent 33ba537728
commit 7f38355860
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 13 additions and 2 deletions

View file

@ -22,6 +22,7 @@ git-annex (10.20230627) UNRELEASED; urgency=medium
* S3: Allow setting publicurl=yes without public=yes, to support
buckets that are configured with a Bucket Policy that allows public
access.
* dropunused: Support --jobs
-- Joey Hess <id@joeyh.name> Mon, 26 Jun 2023 13:10:40 -0400

View file

@ -20,7 +20,7 @@ import Annex.Content
import qualified Utility.RawFilePath as R
cmd :: Command
cmd = withAnnexOptions [jsonOptions] $
cmd = withAnnexOptions [jobsOption, jsonOptions] $
command "dropunused" SectionMaintenance
"drop unused file content"
(paramRepeating paramNumRange) (seek <$$> optParser)
@ -36,7 +36,7 @@ optParser desc = DropUnusedOptions
<*> optional (Command.Drop.parseDropFromOption)
seek :: DropUnusedOptions -> CommandSeek
seek o = do
seek o = startConcurrency commandStages $ do
numcopies <- getNumCopies
mincopies <- getMinCopies
from <- maybe (pure Nothing) (Just <$$> getParsed) (dropFrom o)

View file

@ -28,6 +28,14 @@ Or, specify "all" to drop all unused data.
the last repository that is storing their content. Data loss can
result from using this option.
* `--jobs=N` `-JN`
Runs multiple drop jobs in parallel. This is particularly useful
when git-annex has to contact remotes to check if it can drop content.
For example: `-J4`
Setting this to "cpus" will run one job per CPU core.
* `--json`
Enable JSON output. This is intended to be parsed by programs that use

View file

@ -1 +1,3 @@
Simple "drop" have it, but no for "dropunused". Missed?
> [[fixed|done]] --[[Joey]]