From 7f38355860d82304ff7f347e75a5a769b1bc5a17 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 21 Jul 2023 14:03:34 -0400 Subject: [PATCH] dropunused: Support --jobs Sponsored-by: Kevin Mueller on Patreon --- CHANGELOG | 1 + Command/DropUnused.hs | 4 ++-- doc/git-annex-dropunused.mdwn | 8 ++++++++ doc/todo/add_--jobs_for_dropunused_command.mdwn | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a55accbabe..bb001943cc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 Mon, 26 Jun 2023 13:10:40 -0400 diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs index 32fda45888..2a268f760c 100644 --- a/Command/DropUnused.hs +++ b/Command/DropUnused.hs @@ -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) diff --git a/doc/git-annex-dropunused.mdwn b/doc/git-annex-dropunused.mdwn index 739c59c1c6..31f6abf114 100644 --- a/doc/git-annex-dropunused.mdwn +++ b/doc/git-annex-dropunused.mdwn @@ -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 diff --git a/doc/todo/add_--jobs_for_dropunused_command.mdwn b/doc/todo/add_--jobs_for_dropunused_command.mdwn index 5ea4110516..6128ff2f58 100644 --- a/doc/todo/add_--jobs_for_dropunused_command.mdwn +++ b/doc/todo/add_--jobs_for_dropunused_command.mdwn @@ -1 +1,3 @@ Simple "drop" have it, but no for "dropunused". Missed? + +> [[fixed|done]] --[[Joey]] -- 2.30.2