-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Problem
Sometimes you want to know about the repo config before you open the repo. For this there is already the classmethod Repository.fetch_config(). But once you have this config, Repository.open() will re-download the config that you already have. This means an unnecessary extra roundtrip to remote storage.
Proposed Solution
A new piece of API that allows opening a repo without re-downloading the config. e.g. Repository.open_with_config.
Additional context
I'm not totally sure what to name this new method - Repository.open() already has a config kwarg, but its meaning is subtly different:
configinRepo.openmeans "fetch the stored repo config, merge it with the config passed by the user, then use that merged config to open the repo",configinRepo.open_with_configmeans "don't fetch the stored repo config at all (so ignoring it entirely), and use the config passed by the user to open the repo".
So maybe we call the new method .open_using_config or .open_with_config_override?
In fact maybe a new method isn't required at all, we could just add a new kwarg override_config: bool kwarg to Repository.open...
I also have to say that I don't understand how Repository.reopen() is different.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status