History

cli: load configs from .jj/repo/config.toml

Since per-repo config may contain CLI settings, it must be visible to CLI. Therefore, UserSettings::with_repo() -> RepoSettings isn't used, and its implementation is nullified by this commit. #616

Yuya Nishihara committed 3 years ago

Commit ea96ea31 parent 810789a8 files · +130 −14Browse files

Showing the changes to lib/src (1 of 8 files). Show all

Unified · Split

lib/src/settings.rs+4−9
@@ -61,15 +61,10 @@ impl UserSettings { · 60 unmodified lines
6161 }
6262 }
6363
64− pub fn with_repo(&self, repo_path: &Path) -> Result<RepoSettings, config::ConfigError> {
65− let config = config::Config::builder()
66− .add_source(self.config.clone())
67− .add_source(
68− config::File::from(repo_path.join("config"))
69− .required(false)
70− .format(config::FileFormat::Toml),
71− )
72− .build()?;
64+ // TODO: Reconsider UserSettings/RepoSettings abstraction. See
65+ // https://github.com/martinvonz/jj/issues/616#issuecomment-1345170699
66+ pub fn with_repo(&self, _repo_path: &Path) -> Result<RepoSettings, config::ConfigError> {
67+ let config = self.config.clone();
7368 Ok(RepoSettings { _config: config })
7469 }
7570

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t