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
61 }61 }
62 }62 }
63 63
64 pub fn with_repo(&self, repo_path: &Path) -> Result<RepoSettings, config::ConfigError> {64 // TODO: Reconsider UserSettings/RepoSettings abstraction. See
65 let config = config::Config::builder()65 // https://github.com/martinvonz/jj/issues/616#issuecomment-1345170699
66 .add_source(self.config.clone())66 pub fn with_repo(&self, _repo_path: &Path) -> Result<RepoSettings, config::ConfigError> {
67 .add_source(67 let config = self.config.clone();
68 config::File::from(repo_path.join("config"))
69 .required(false)
70 .format(config::FileFormat::Toml),
71 )
72 .build()?;
73 Ok(RepoSettings { _config: config })68 Ok(RepoSettings { _config: config })
74 }69 }
75 70

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