From 114a2d7504c94e791218431abc1edbe7d21f9fa2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Jun 2023 10:01:42 -0400 Subject: [PATCH] Fix display when run with -J1 Commit b6642dde8a49f34d7983a40e99bf7032a731c964 broke it by enabling non-concurrent display mode while leaving concurrency set in the config and having already started concurrency earlier. (I don't actually know if that commit was a good idea.) Sponsored-By: Brett Eisenberg on Patreon --- CHANGELOG | 1 + CmdLine/Action.hs | 11 ++++++----- doc/bugs/J1_display_issue.mdwn | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0164a00ffc..941fe562cd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -90,6 +90,7 @@ git-annex (10.20230408) UNRELEASED; urgency=medium is configured, the same as git-annex add does. * config: Added the --show-origin and --for-file options. * config: Support annex.numcopies and annex.mincopies. + * Fix display when run with -J1. -- Joey Hess Sat, 08 Apr 2023 13:57:18 -0400 diff --git a/CmdLine/Action.hs b/CmdLine/Action.hs index 412cab8f4a..b274065682 100644 --- a/CmdLine/Action.hs +++ b/CmdLine/Action.hs @@ -74,9 +74,7 @@ commandAction start = do st <- Annex.getState id case getConcurrency' (Annex.concurrency st) of NonConcurrent -> runnonconcurrent (Annex.sizelimit st) - Concurrent n - | n > 1 -> runconcurrent (Annex.sizelimit st) (Annex.workers st) - | otherwise -> runnonconcurrent (Annex.sizelimit st) + Concurrent _ -> runconcurrent (Annex.sizelimit st) (Annex.workers st) ConcurrentPerCpu -> runconcurrent (Annex.sizelimit st) (Annex.workers st) where runnonconcurrent sizelimit = start >>= \case @@ -235,8 +233,11 @@ startConcurrency usedstages a = do let usegitcfg = setConcurrency (ConcurrencyGitConfig fromgitcfg) case (fromcmdline, fromgitcfg) of (NonConcurrent, NonConcurrent) -> a - (Concurrent n, _) -> - goconcurrent n + (Concurrent n, _) + | n > 1 -> goconcurrent n + | otherwise -> do + setConcurrency' NonConcurrent ConcurrencyCmdLine + a (ConcurrentPerCpu, _) -> goconcurrentpercpu (NonConcurrent, Concurrent n) -> do diff --git a/doc/bugs/J1_display_issue.mdwn b/doc/bugs/J1_display_issue.mdwn index 67e7f3318d..d0591f16f2 100644 --- a/doc/bugs/J1_display_issue.mdwn +++ b/doc/bugs/J1_display_issue.mdwn @@ -9,3 +9,5 @@ The filename is displayed at end. This does not happen at -J2 or without -J. --[[Joey]] + +> [[fixed|done]] --[[Joey]]