Skip to content

Commit

Permalink
config: update comment about new config file creation
Browse files Browse the repository at this point in the history
Spotted while updating get_new_config_file_path() callers. "jj config path"
isn't a command to create new config file.
  • Loading branch information
yuja committed Nov 30, 2024
1 parent ecf25a1 commit e1cd1a0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ impl ConfigEnv {
match &self.user_config_path {
ConfigPath::Existing(path) => Ok(Some(path)),
ConfigPath::New(path) => {
// TODO: should we update self.user_config_path to Existing?
// TODO: Maybe we shouldn't create new file here. Not all
// callers need an empty file. For example, "jj config path"
// should be a readonly operation. "jj config set" doesn't have
// to create an empty file to be overwritten. Since it's unclear
// who and when to update ConfigPath::New(_) to ::Existing(_),
// it's probably better to not cache the path existence.
create_config_file(path)?;
Ok(Some(path))
}
Expand Down Expand Up @@ -308,10 +313,7 @@ impl ConfigEnv {
pub fn new_repo_config_path(&self) -> Option<&Path> {
match &self.repo_config_path {
ConfigPath::Existing(path) => Some(path),
ConfigPath::New(path) => {
// TODO: should we create new file?
Some(path)
}
ConfigPath::New(path) => Some(path),
ConfigPath::Unavailable => None,
}
}
Expand Down

0 comments on commit e1cd1a0

Please sign in to comment.