Improve startup time for commands that do not operate on remotes
And for tab completion, by not unnessessarily statting paths to remotes, which used to cause eg, spin-up of removable drives. Got rid of the remotes member of Git.Repo. This was a bit painful. Remote.Git modifies the list of remotes as it reads their configs, so still need a persistent list of remotes. So, put it in as Annex.gitremotes. It's only populated by getGitRemotes, so commands like examinekey that don't care about remotes won't do so. This commit was sponsored by Jake Vosloo on Patreon.
This commit is contained in:
parent
d0fe4d7308
commit
2b66492d6e
22 changed files with 148 additions and 70 deletions
|
@ -36,7 +36,7 @@ seek = withWords start
|
|||
|
||||
start :: [String] -> CommandStart
|
||||
start [] = unknownNameError "Specify the remote to enable."
|
||||
start (name:rest) = go =<< filter matchingname <$> Annex.fromRepo Git.remotes
|
||||
start (name:rest) = go =<< filter matchingname <$> Annex.getGitRemotes
|
||||
where
|
||||
matchingname r = Git.remoteName r == Just name
|
||||
go [] = startSpecialRemote name (Logs.Remote.keyValToConfig rest)
|
||||
|
@ -104,7 +104,7 @@ unknownNameError prefix = do
|
|||
else Remote.prettyPrintUUIDsDescs
|
||||
"known special remotes"
|
||||
descm (M.keys m)
|
||||
disabledremotes <- filterM isdisabled =<< Annex.fromRepo Git.remotes
|
||||
disabledremotes <- filterM isdisabled =<< Annex.getGitRemotes
|
||||
let remotesmsg = unlines $ map ("\t" ++) $
|
||||
mapMaybe Git.remoteName disabledremotes
|
||||
giveup $ concat $ filter (not . null) [prefix ++ "\n", remotesmsg, specialmsg]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue