edit in pijul-repository/src/lib.rs at line 4
[20.20]→[20.21540:21541](∅→∅),
[20.55]→[20.21540:21541](∅→∅),
[20.21540]→[20.21540:21541](∅→∅),
[20.24]→[20.24:52](∅→∅) −
− use pijul_config as config;
edit in pijul-repository/src/lib.rs at line 13
[20.70]→[20.21758:21790](∅→∅),
[20.96]→[20.21758:21790](∅→∅),
[20.21758]→[20.21758:21790](∅→∅) − pub config: config::Config,
edit in pijul-repository/src/lib.rs at line 85
[19.1137]→[19.1137:1196](∅→∅),
[19.1196]→[20.23040:23041](∅→∅),
[20.23040]→[20.23040:23041](∅→∅),
[20.23515]→[20.23515:23586](∅→∅),
[20.23586]→[20.588:664](∅→∅),
[20.664]→[20.23644:23686](∅→∅),
[20.23644]→[20.23644:23686](∅→∅),
[20.23686]→[20.7776:7856](∅→∅),
[20.7856]→[20.23779:23793](∅→∅),
[20.23779]→[20.23779:23793](∅→∅),
[20.23793]→[20.23793:23848](∅→∅),
[20.23848]→[20.23848:23859](∅→∅) − let config_path = dot_directory.join(CONFIG_FILE);
−
− let config = if let Ok(config) = std::fs::read(&config_path) {
− if let Ok(toml) = toml::from_str(&String::from_utf8(config)?) {
− toml
− } else {
− bail!("Could not read configuration file at {:?}", config_path)
− }
− } else {
− config::Config::default()
− };
edit in pijul-repository/src/lib.rs at line 95
[20.484]→[20.24200:24220](∅→∅),
[20.24200]→[20.24200:24220](∅→∅) edit in pijul-repository/src/lib.rs at line 101
+ config: &pijul_config::Config,
replacement in pijul-repository/src/lib.rs at line 118
[20.24728]→[20.658:700](∅→∅) − init_dot_ignore(&cur, kind)?;
+ init_dot_ignore(config, &cur, kind)?;
edit in pijul-repository/src/lib.rs at line 133
[20.646]→[20.25157:25208](∅→∅),
[20.25157]→[20.25157:25208](∅→∅) − config: config::Config::default(),
edit in pijul-repository/src/lib.rs at line 140
[20.25358]→[20.0:64](∅→∅),
[20.64]→[20.64:217](∅→∅) −
− pub fn update_config(&self) -> Result<(), anyhow::Error> {
− std::fs::write(
− self.path.join(DOT_DIR).join("config"),
− toml::to_string(&self.config)?,
− )?;
− Ok(())
− }
replacement in pijul-repository/src/lib.rs at line 158
[20.608]→[20.901:989](∅→∅) − fn init_dot_ignore(base_path: &Path, kind: Option<&str>) -> Result<(), anyhow::Error> {
+ fn init_dot_ignore(
+ config: &pijul_config::Config,
+ base_path: &Path,
+ kind: Option<&str>,
+ ) -> Result<(), anyhow::Error> {
replacement in pijul-repository/src/lib.rs at line 180
− ignore_specific(&mut dot_ignore, kind)
+ ignore_specific(config, &mut dot_ignore, kind)
edit in pijul-repository/src/lib.rs at line 187
+ config: &pijul_config::Config,
replacement in pijul-repository/src/lib.rs at line 193
[20.984]→[20.54:118](∅→∅),
[20.118]→[20.209:493](∅→∅),
[20.209]→[20.209:493](∅→∅) − if let Ok((config, _)) = pijul_config::Global::load() {
− let ignore_kinds = config.ignore_kinds.as_ref();
− if let Some(kinds) = ignore_kinds.and_then(|x| x.get(kind)) {
− for entry in kinds.iter() {
− writeln!(dot_ignore, "{}", entry)?;
− }
− return Ok(());
+ if let Some(kinds) = config.ignore_kinds.get(kind) {
+ for entry in kinds.iter() {
+ writeln!(dot_ignore, "{}", entry)?;
edit in pijul-repository/src/lib.rs at line 197
edit in pijul-remote/src/ssh.rs at line 100
+ config: &pijul_config::Config,
replacement in pijul-remote/src/ssh.rs at line 124
[20.363]→[20.27694:27761](∅→∅),
[20.727]→[20.27694:27761](∅→∅),
[20.27694]→[20.27694:27761](∅→∅),
[20.27761]→[20.728:812](∅→∅) − let config = Arc::new(thrussh::client::Config::default());
− let mut h = thrussh::client::connect_stream(config, stream, client).await?;
+ let client_config = Arc::new(thrussh::client::Config::default());
+ let mut h = thrussh::client::connect_stream(client_config, stream, client).await?;
replacement in pijul-remote/src/ssh.rs at line 133
− if self.auth_pk(&mut h, &mut key_path).await? {
+ if self.auth_pk(config, &mut h, &mut key_path).await? {
replacement in pijul-remote/src/ssh.rs at line 145
[20.484]→[20.477:531](∅→∅),
[20.477]→[20.477:531](∅→∅) − self.auth_password(&mut h).await?
+ self.auth_password(config, &mut h).await?
edit in pijul-remote/src/ssh.rs at line 234
+ config: &pijul_config::Config,
replacement in pijul-remote/src/ssh.rs at line 254
[20.1251]→[20.136:207](∅→∅) − let password = pijul_interaction::Password::new()?
+ let password = pijul_interaction::Password::new(config)?
edit in pijul-remote/src/ssh.rs at line 286
+ config: &pijul_config::Config,
replacement in pijul-remote/src/ssh.rs at line 307
[20.2923]→[20.473:536](∅→∅) − let password = pijul_interaction::Password::new()?
+ let password = pijul_interaction::Password::new(config)?
replacement in pijul-remote/src/lib.rs at line 16
[20.52]→[20.246:267](∅→∅),
[20.483]→[20.246:267](∅→∅) + use pijul_config::remote::{RemoteConfig, RemoteHttpHeader};
+ use pijul_config::shell_cmd;
replacement in pijul-remote/src/lib.rs at line 51
+ config: &pijul_config::Config,
replacement in pijul-remote/src/lib.rs at line 60
[20.325]→[20.325:469](∅→∅) − if let Some(name) = repo.config.remotes.iter().find(|e| e.name() == name) {
− name.to_remote(channel, no_cert_check, with_path).await
+ if let Some(name) = config.remotes.iter().find(|e| e.name() == name) {
+ name.to_remote(config, channel, no_cert_check, with_path)
+ .await
replacement in pijul-remote/src/lib.rs at line 64
[20.482]→[20.482:569](∅→∅) − unknown_remote(self_path, user, name, channel, no_cert_check, with_path).await
+ unknown_remote(
+ config,
+ self_path,
+ user,
+ name,
+ channel,
+ no_cert_check,
+ with_path,
+ )
+ .await
edit in pijul-remote/src/lib.rs at line 80
+ config: &pijul_config::Config,
replacement in pijul-remote/src/lib.rs at line 93
[20.573]→[20.573:1129](∅→∅) − let mut remote = if let Ok(repo) = Repository::find_root(None) {
− repository(
− &repo,
− None,
− Some(&identity.config.author.username),
− &remote,
− libpijul::DEFAULT_CHANNEL,
− no_cert_check,
− false,
− )
− .await?
− } else {
− unknown_remote(
− None,
− Some(&identity.config.author.username),
− &remote,
− libpijul::DEFAULT_CHANNEL,
− no_cert_check,
− false,
− )
− .await?
− };
+ let mut remote = repository(
+ config,
+ None,
+ Some(&identity.config.author.username),
+ &remote,
+ libpijul::DEFAULT_CHANNEL,
+ no_cert_check,
+ false,
+ )
+ .await?;
replacement in pijul-remote/src/lib.rs at line 108
[20.1222]→[20.1222:1257](∅→∅) − .decrypt(&identity.name)?;
+ .decrypt(config, &identity.name)?;
edit in pijul-remote/src/lib.rs at line 118
+ config: &pijul_config::Config,
edit in pijul-remote/src/lib.rs at line 128
+ config: &pijul_config::Config,
replacement in pijul-remote/src/lib.rs at line 137
[20.586]→[20.586:659](∅→∅) − if let Some(c) = sshr.connect(ssh, channel).await? {
+ if let Some(c) = sshr.connect(config, ssh, channel).await? {
edit in pijul-remote/src/lib.rs at line 174
+ config: &pijul_config::Config,
replacement in pijul-remote/src/lib.rs at line 198
[20.663]→[20.466:535](∅→∅) − if let Some(c) = ssh.connect(name, channel).await? {
+ if let Some(c) = ssh.connect(config, name, channel).await? {
replacement in pijul-remote/src/lib.rs at line 241
[20.884]→[20.1422:1483](∅→∅) − if let Some(c) = ssh.connect(name, channel).await? {
+ if let Some(c) = ssh.connect(config, name, channel).await? {
replacement in pijul-interaction/src/input/mod.rs at line 7
[20.8269]→[20.8269:8291](∅→∅) + use dialoguer::theme::Theme;
replacement in pijul-interaction/src/input/mod.rs at line 10
[20.8392]→[8.1069:1138](∅→∅) − use pijul_config::{self as config, Choice};
− use std::sync::LazyLock;
+ use std::sync::OnceLock;
replacement in pijul-interaction/src/input/mod.rs at line 12
[20.8553]→[8.1139:1336](∅→∅) − static THEME: LazyLock<Box<dyn theme::Theme + Send + Sync>> = LazyLock::new(|| {
− if let Ok((config, _)) = config::Global::load() {
− let color_choice = config.colors.unwrap_or_default();
+ static THEME: OnceLock<Box<dyn Theme + Send + Sync>> = OnceLock::new();
edit in pijul-interaction/src/input/mod.rs at line 14
[20.8678]→[8.1337:1510](∅→∅),
[8.1510]→[20.8945:8955](∅→∅),
[20.8945]→[20.8945:8955](∅→∅),
[20.8955]→[8.1511:1581](∅→∅),
[8.1581]→[20.8964:8965](∅→∅),
[20.8964]→[20.8964:8965](∅→∅) − match color_choice {
− Choice::Auto | Choice::Always => Box::<theme::ColorfulTheme>::default(),
− Choice::Never => Box::new(theme::SimpleTheme),
− }
− } else {
− Box::<theme::ColorfulTheme>::default()
− }
− });
−
replacement in pijul-interaction/src/input/mod.rs at line 60
[20.10665]→[20.10665:10718](∅→∅) − pub fn new() -> Result<Self, InteractionError> {
+ pub fn new(config: &pijul_config::Config) -> Result<Self, InteractionError> {
replacement in pijul-interaction/src/input/mod.rs at line 62
[20.10764]→[20.10764:10865](∅→∅) − InteractiveContext::Terminal => Box::new(terminal::handler::with_theme(THEME.as_ref())),
+ InteractiveContext::Terminal => {
+ let theme = THEME.get_or_init(|| config.theme());
+ Box::new(terminal::handler::with_theme(theme.as_ref()))
+ }
replacement in pijul-identity/src/repair.rs at line 1
[20.97]→[20.343:364](∅→∅),
[20.364]→[20.516:544](∅→∅),
[20.544]→[20.190:191](∅→∅),
[20.190]→[20.190:191](∅→∅) − use super::Complete;
− use pijul_config as config;
−
+ use crate::{Complete, IdentityConfig};
edit in pijul-identity/src/repair.rs at line 3
+ use pijul_config::author::Author;
+ use pijul_config::global::Global;
replacement in pijul-identity/src/repair.rs at line 42
[20.3347]→[20.338:399](∅→∅),
[20.399]→[20.3509:3565](∅→∅),
[20.3509]→[20.3509:3565](∅→∅) − pub async fn fix_identities() -> Result<(), anyhow::Error> {
− let mut dir = config::global_config_dir().unwrap();
+ pub async fn fix_identities(config: &pijul_config::Config) -> Result<(), anyhow::Error> {
+ let config_path = Global::config_file().unwrap();
+ let mut dir = config_path.parent().unwrap().to_path_buf();
+
replacement in pijul-identity/src/repair.rs at line 55
[20.3880]→[20.365:426](∅→∅) − let extraction_result = Complete::from_old_format();
+ let extraction_result = Complete::from_old_format(config);
replacement in pijul-identity/src/repair.rs at line 65
[20.4220]→[20.400:458](∅→∅) − old_identity.clone().create(true).await?;
+ old_identity.clone().create(config, true).await?;
replacement in pijul-identity/src/repair.rs at line 91
[20.6256]→[20.459:525](∅→∅) − Complete::default()?.create(true).await?;
+ Complete::default(config)?.create(config, true).await?;
replacement in pijul-identity/src/repair.rs at line 103
[20.6618]→[20.6618:6650](∅→∅) − identity.valid_keys()?;
+ identity.valid_keys(config)?;
replacement in pijul-identity/src/repair.rs at line 111
[20.6735]→[20.6735:6793](∅→∅) − fn valid_keys(&self) -> Result<bool, anyhow::Error> {
+ fn valid_keys(&self, config: &pijul_config::Config) -> Result<bool, anyhow::Error> {
replacement in pijul-identity/src/repair.rs at line 113
[20.563]→[20.563:629](∅→∅) − let decryped_public_key = self.decrypt()?.0.public_key();
+ let decryped_public_key = self.decrypt(config)?.0.public_key();
edit in pijul-identity/src/repair.rs at line 131
+ /// * `config` - User-specified configuration values to change runtime behaviour
replacement in pijul-identity/src/repair.rs at line 176
[20.9995]→[20.1053:1116](∅→∅),
[20.1116]→[20.10086:10208](∅→∅),
[20.10086]→[20.10086:10208](∅→∅) − fn from_old_format() -> Result<Self, IdentityParseError> {
− let config_dir = config::global_config_dir().unwrap();
−
− let config_path = config_dir.join("config.toml");
+ fn from_old_format(config: &pijul_config::Config) -> Result<Self, IdentityParseError> {
+ let config_path = Global::config_file().unwrap();
+ let config_dir = config_path.parent().unwrap();
+ let config_path = config_dir.join(pijul_config::CONFIG_FILE);
edit in pijul-identity/src/repair.rs at line 263
[20.13840]→[20.13840:13841](∅→∅),
[20.13841]→[20.1325:1387](∅→∅),
[20.1387]→[20.13904:14203](∅→∅),
[20.13904]→[20.13904:14203](∅→∅) −
− let config: super::Config = if config_path.exists() {
− let mut config_file =
− fs::File::open(&config_path).context("Failed to open config file")?;
− let mut config_text = String::new();
− config_file
− .read_to_string(&mut config_text)
− .context("Failed to read config file")?;
replacement in pijul-identity/src/repair.rs at line 264
[20.14204]→[20.14204:14336](∅→∅) − let config_data: config::Global =
− toml::from_str(&config_text).context("Failed to parse config file")?;
+ let identity_config: IdentityConfig = if config_path.exists() {
+ let config_path = Global::config_file().unwrap();
+ let config_text = Global::read_contents(&config_path)?;
+ let config_data = Global::parse_contents(&config_path, &config_text)?;
replacement in pijul-identity/src/repair.rs at line 269
[20.1389]→[20.1389:1417](∅→∅) replacement in pijul-identity/src/repair.rs at line 274
[20.14384]→[20.1539:1595](∅→∅) − let mut author = config::Author::default();
+ let mut author = Author::default();
replacement in pijul-identity/src/repair.rs at line 279
[20.14647]→[20.1719:1747](∅→∅) replacement in pijul-identity/src/repair.rs at line 287
[20.14980]→[20.1818:1838](∅→∅) replacement in pijul-identity/src/repair.rs at line 292
[20.15446]→[20.15446:15482](∅→∅) − if identity.valid_keys()? {
+ if identity.valid_keys(config)? {
edit in pijul-identity/src/load.rs at line 3
[20.1564]→[20.600:628](∅→∅),
[20.22467]→[20.600:628](∅→∅) − use pijul_config as config;
edit in pijul-identity/src/load.rs at line 5
+ use pijul_config::global::Global;
edit in pijul-identity/src/load.rs at line 26
[20.23162]→[20.23162:23297](∅→∅) − let mut path = config::global_config_dir()
− .expect("Could not find global config directory")
− .join("identities");
−
replacement in pijul-identity/src/load.rs at line 30
[20.23384]→[20.23384:23405](∅→∅) + let config_file_path = Global::config_file().unwrap();
+ let config_directory = config_file_path
+ .parent()
+ .expect("Could not find global config directory");
+ let path = config_directory.join("identities").join(name);
+
edit in pijul-identity/src/load.rs at line 67
+ /// # Arguments
+ /// * `config` - User-specified configuration values to change runtime behaviour
+ ///
replacement in pijul-identity/src/load.rs at line 72
[20.24577]→[20.526:597](∅→∅) − pub async fn choose_identity_name() -> Result<String, anyhow::Error> {
+ pub async fn choose_identity_name(config: &pijul_config::Config) -> Result<String, anyhow::Error> {
replacement in pijul-identity/src/load.rs at line 79
[20.24848]→[20.598:631](∅→∅) − fix_identities().await?;
+ fix_identities(config).await?;
replacement in pijul-identity/src/load.rs at line 86
[20.25168]→[20.1005:1040](∅→∅) − let index = Select::new()?
+ let index = Select::new(config)?
replacement in pijul-identity/src/load.rs at line 126
[20.27540]→[20.27540:27603](∅→∅) − let config_dir = config::global_config_dir().unwrap();
+ let config_file = Global::config_file().unwrap();
+ let config_dir = config_file.parent().unwrap();
replacement in pijul-identity/src/lib.rs at line 45
[20.17102]→[20.545:599](∅→∅) − use pijul_config as config;
− use pijul_config::Author;
+ use pijul_config::author::Author;
replacement in pijul-identity/src/lib.rs at line 48
[20.17232]→[20.17232:17273](∅→∅) − use std::fs;
− use std::io::{Read, Write};
replacement in pijul-identity/src/lib.rs at line 57
[20.17300]→[20.0:63](∅→∅),
[20.63]→[20.2190:2210](∅→∅),
[20.2190]→[20.2190:2210](∅→∅) − #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
− pub struct Config {
+ #[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)]
+ pub struct IdentityConfig {
edit in pijul-identity/src/lib.rs at line 63
[20.2354]→[20.2354:2508](∅→∅) − }
−
− impl Default for Config {
− fn default() -> Self {
− Self {
− key_path: None,
− author: Author::default(),
− }
− }
replacement in pijul-identity/src/lib.rs at line 65
[20.2511]→[20.2511:2542](∅→∅) − impl From<Author> for Config {
+ impl From<Author> for IdentityConfig {
replacement in pijul-identity/src/lib.rs at line 103
[20.3255]→[20.3255:3348](∅→∅) − pub fn decrypt(&mut self, name: &str) -> Result<(SKey, Option<String>), anyhow::Error> {
+ pub fn decrypt(
+ &mut self,
+ config: &pijul_config::Config,
+ name: &str,
+ ) -> Result<(SKey, Option<String>), anyhow::Error> {
replacement in pijul-identity/src/lib.rs at line 134
[20.4463]→[20.792:844](∅→∅) − password_attempt = Password::new()?
+ password_attempt = Password::new(config)?
replacement in pijul-identity/src/lib.rs at line 162
[20.5137]→[20.5137:5161](∅→∅) + pub config: IdentityConfig,
replacement in pijul-identity/src/lib.rs at line 179
[20.18075]→[20.5524:5548](∅→∅) + config: IdentityConfig,
replacement in pijul-identity/src/lib.rs at line 197
[20.18433]→[20.18433:18571](∅→∅),
[20.18571]→[20.5844:5899](∅→∅),
[20.5899]→[20.18634:18807](∅→∅),
[20.18634]→[20.18634:18807](∅→∅) − pub fn default() -> Result<Self, anyhow::Error> {
− let config_path = config::global_config_dir().unwrap().join("config.toml");
− let author: Author = if config_path.exists() {
− let mut config_file = fs::File::open(&config_path)?;
− let mut config_text = String::new();
− config_file.read_to_string(&mut config_text)?;
+ pub fn default(config: &pijul_config::Config) -> Result<Self, anyhow::Error> {
+ // let config_path = config::global_config_dir().unwrap().join("config.toml");
+ // let author: Author = if config_path.exists() {
+ // let mut config_file = fs::File::open(&config_path)?;
+ // let mut config_text = String::new();
+ // config_file.read_to_string(&mut config_text)?;
replacement in pijul-identity/src/lib.rs at line 204
[20.18808]→[20.18808:18937](∅→∅),
[20.18937]→[20.5900:5930](∅→∅),
[20.5930]→[20.19100:19111](∅→∅),
[20.19100]→[20.19100:19111](∅→∅) − let global_config: config::Global = toml::from_str(&config_text)?;
− global_config.author
− } else {
− Author::default()
− };
+ // let global_config: config::Global = toml::from_str(&config_text)?;
+ // global_config.author
+ // } else {
+ // Author::default()
+ // };
replacement in pijul-identity/src/lib.rs at line 215
[20.19269]→[20.5931:5965](∅→∅) + IdentityConfig::from(config.author.to_owned()),
replacement in pijul-identity/src/lib.rs at line 236
[20.291]→[20.6588:6617](∅→∅),
[20.6588]→[20.6588:6617](∅→∅) + config: IdentityConfig {
replacement in pijul-identity/src/lib.rs at line 247
[20.6972]→[20.6972:7111](∅→∅) − pub fn decrypt(&self) -> Result<(SKey, Option<String>), anyhow::Error> {
− self.credentials.clone().unwrap().decrypt(&self.name)
+ pub fn decrypt(
+ &self,
+ config: &pijul_config::Config,
+ ) -> Result<(SKey, Option<String>), anyhow::Error> {
+ self.credentials
+ .clone()
+ .unwrap()
+ .decrypt(config, &self.name)
replacement in pijul-identity/src/lib.rs at line 257
[20.7118]→[20.7118:7232](∅→∅) − fn change_password(&mut self) -> Result<(), anyhow::Error> {
− let (decryped_key, _) = self.decrypt()?;
+ fn change_password(&mut self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
+ let (decryped_key, _) = self.decrypt(config)?;
replacement in pijul-identity/src/lib.rs at line 260
[20.7233]→[20.890:935](∅→∅) − let user_password = Password::new()?
+ let user_password = Password::new(config)?
edit in pijul-identity/src/create.rs at line 18
+ /// * `config` - User-specified configuration values to change runtime behaviour
edit in pijul-identity/src/create.rs at line 22
+ config: &pijul_config::Config,
replacement in pijul-identity/src/create.rs at line 29
[20.29270]→[20.1263:1305](∅→∅) − new_identity.name = Input::new()?
+ new_identity.name = Input::new(config)?
replacement in pijul-identity/src/create.rs at line 63
[20.30212]→[20.1605:1669](∅→∅) − new_identity.config.author.display_name = Input::new()?
+ new_identity.config.author.display_name = Input::new(config)?
replacement in pijul-identity/src/create.rs at line 69
[20.30597]→[20.1734:1791](∅→∅) − new_identity.config.author.email = Input::new()?
+ new_identity.config.author.email = Input::new(config)?
replacement in pijul-identity/src/create.rs at line 84
[20.9436]→[20.1929:1956](∅→∅) + if Confirm::new(config)?
replacement in pijul-identity/src/create.rs at line 97
[20.10379]→[20.10379:10424](∅→∅) − new_identity.change_password()?;
+ new_identity.change_password(config)?;
replacement in pijul-identity/src/create.rs at line 101
[20.10497]→[20.10497:10536](∅→∅) − new_identity.prompt_expiry()?;
+ new_identity.prompt_expiry(config)?;
replacement in pijul-identity/src/create.rs at line 104
[20.1393]→[20.1393:1424](∅→∅) + if Confirm::new(config)?
replacement in pijul-identity/src/create.rs at line 109
[20.855]→[20.1569:1622](∅→∅) − new_identity.prompt_remote().await?;
+ new_identity.prompt_remote(config).await?;
replacement in pijul-identity/src/create.rs at line 123
[20.10891]→[20.10891:10957](∅→∅) − async fn prompt_ssh(&mut self) -> Result<(), anyhow::Error> {
+ async fn prompt_ssh(&mut self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
replacement in pijul-identity/src/create.rs at line 128
[20.11181]→[20.2082:2121](∅→∅) − let selection = Select::new()?
+ let selection = Select::new(config)?
replacement in pijul-identity/src/create.rs at line 160
[20.12406]→[20.1520:1589](∅→∅),
[20.1589]→[20.2187:2239](∅→∅) − async fn prompt_remote(&mut self) -> Result<(), anyhow::Error> {
− self.config.author.username = Input::new()?
+ async fn prompt_remote(&mut self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
+ self.config.author.username = Input::new(config)?
replacement in pijul-identity/src/create.rs at line 167
[20.12819]→[20.2314:2364](∅→∅) − self.config.author.origin = Input::new()?
+ self.config.author.origin = Input::new(config)?
replacement in pijul-identity/src/create.rs at line 173
[20.13093]→[20.2449:2476](∅→∅) + if Confirm::new(config)?
replacement in pijul-identity/src/create.rs at line 185
[20.4542]→[20.4542:4580](∅→∅) − self.prompt_ssh().await?;
+ self.prompt_ssh(config).await?;
replacement in pijul-identity/src/create.rs at line 193
[20.31273]→[20.13410:13473](∅→∅) − fn prompt_expiry(&mut self) -> Result<(), anyhow::Error> {
+ fn prompt_expiry(&mut self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
replacement in pijul-identity/src/create.rs at line 199
[20.31446]→[20.2536:2589](∅→∅) − self.public_key.expires = if Confirm::new()?
+ self.public_key.expires = if Confirm::new(config)?
replacement in pijul-identity/src/create.rs at line 210
[20.500]→[20.500:552](∅→∅) − let expiry_date: String = Input::new()?
+ let expiry_date: String = Input::new(config)?
edit in pijul-identity/src/create.rs at line 269
+ /// * `config` - User-specified configuration values to change runtime behaviour
replacement in pijul-identity/src/create.rs at line 271
[20.38529]→[20.632:713](∅→∅) − pub async fn create(&self, link_remote: bool) -> Result<(), anyhow::Error> {
+ pub async fn create(
+ &self,
+ config: &pijul_config::Config,
+ link_remote: bool,
+ ) -> Result<(), anyhow::Error> {
replacement in pijul-identity/src/create.rs at line 277
[20.14076]→[20.714:794](∅→∅) − let confirmed_identity = self.prompt_changes(None, link_remote).await?;
+ let confirmed_identity = self.prompt_changes(config, None, link_remote).await?;
edit in pijul/src/main.rs at line 5
+ use pijul_config::Config;
edit in pijul/src/main.rs at line 218
+ let repository_path = std::env::current_dir()?;
+ let config = Config::load(&repository_path)?;
+
+ log::debug!("{config:#?}");
+
replacement in pijul/src/main.rs at line 224
[20.88438]→[20.84:169](∅→∅),
[20.169]→[20.88523:88578](∅→∅),
[20.4705]→[20.88523:88578](∅→∅),
[20.88523]→[20.88523:88578](∅→∅),
[20.88578]→[20.497:555](∅→∅),
[20.222]→[20.231:277](∅→∅),
[20.555]→[20.231:277](∅→∅),
[20.88636]→[20.231:277](∅→∅),
[20.277]→[20.102:154](∅→∅),
[20.154]→[20.88682:88786](∅→∅),
[20.277]→[20.88682:88786](∅→∅),
[20.4758]→[20.88682:88786](∅→∅),
[20.88682]→[20.88682:88786](∅→∅),
[20.88786]→[20.223:275](∅→∅) − SubCommand::Log(l) => l.run(),
− SubCommand::Init(init) => init.run(),
− SubCommand::Clone(clone) => clone.run().await,
− SubCommand::Record(record) => record.run().await,
− SubCommand::Diff(diff) => diff.run(),
− SubCommand::Status(status) => status.run(),
− SubCommand::Push(push) => push.run().await,
− SubCommand::Pull(pull) => pull.run().await,
− SubCommand::Change(change) => change.run(),
+ SubCommand::Log(l) => l.run(&config),
+ SubCommand::Init(init) => init.run(&config),
+ SubCommand::Clone(clone) => clone.run(&config).await,
+ SubCommand::Record(record) => record.run(&config).await,
+ SubCommand::Diff(diff) => diff.run(&config),
+ SubCommand::Status(status) => status.run(&config),
+ SubCommand::Push(push) => push.run(&config).await,
+ SubCommand::Pull(pull) => pull.run(&config).await,
+ SubCommand::Change(change) => change.run(&config),
replacement in pijul/src/main.rs at line 242
[20.627]→[20.627:676](∅→∅) − SubCommand::Reset(reset) => reset.run(),
+ SubCommand::Reset(reset) => reset.run(&config),
replacement in pijul/src/main.rs at line 245
[20.772]→[20.772:830](∅→∅) − SubCommand::Unrecord(unrecord) => unrecord.run(),
+ SubCommand::Unrecord(unrecord) => unrecord.run(&config),
replacement in pijul/src/main.rs at line 247
[20.879]→[20.879:931](∅→∅),
[20.931]→[20.89537:89598](∅→∅),
[20.5531]→[20.89537:89598](∅→∅),
[20.89537]→[20.89537:89598](∅→∅),
[20.89598]→[20.932:984](∅→∅),
[20.984]→[20.556:683](∅→∅) − SubCommand::Remote(remote) => remote.run(),
− SubCommand::Archive(archive) => archive.run().await,
− SubCommand::Credit(credit) => credit.run(),
− SubCommand::Tag(tag) => tag.run().await,
− SubCommand::Identity(identity_wizard) => identity_wizard.run().await,
+ SubCommand::Remote(remote) => remote.run(&config),
+ SubCommand::Archive(archive) => archive.run(&config).await,
+ SubCommand::Credit(credit) => credit.run(&config),
+ SubCommand::Tag(tag) => tag.run(&config).await,
+ SubCommand::Identity(identity_wizard) => identity_wizard.run(&config).await,
replacement in pijul/src/commands/unrecord.rs at line 32
[20.96125]→[20.1028:1080](∅→∅) − pub fn run(self) -> Result<(), anyhow::Error> {
+ pub fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
edit in pijul/src/commands/unrecord.rs at line 34
[13.239]→[20.96236:96273](∅→∅),
[20.313]→[20.96236:96273](∅→∅),
[20.1118]→[20.96236:96273](∅→∅),
[20.5791]→[20.96236:96273](∅→∅),
[20.13400]→[20.96236:96273](∅→∅),
[20.96236]→[20.96236:96273](∅→∅) − debug!("{:?}", repo.config);
replacement in pijul/src/commands/unrecord.rs at line 45
− } else if let Some(n) = repo.config.unrecord_changes {
+ } else if let Some(n) = config.unrecord_changes {
replacement in pijul/src/commands/unrecord.rs at line 48
[20.2745]→[20.658:720](∅→∅),
[20.720]→[20.2936:3330](∅→∅),
[20.13464]→[20.2936:3330](∅→∅),
[20.2936]→[20.2936:3330](∅→∅) − let (cfg, _) = pijul_config::Global::load()?;
− cfg.unrecord_changes.ok_or_else(|| {
− anyhow!(
− "Can't determine how many changes to show. \
− Please set the `unrecord_changes` option in \
− your global config or run `pijul unrecord` \
− with the `--show-changes` option."
− )
− })?
+ return Err(anyhow!(
+ "Can't determine how many changes to show. \
+ Please set the `unrecord_changes` option in \
+ your config or run `pijul unrecord` \
+ with the `--show-changes` option."
+ ));
replacement in pijul/src/commands/tag.rs at line 76
− pub async fn run(self) -> Result<(), anyhow::Error> {
+ pub async fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
replacement in pijul/src/commands/tag.rs at line 111
[20.2976]→[20.59:142](∅→∅) − let header = header(author.as_deref(), message, timestamp).await?;
+ let header = header(config, author.as_deref(), message, timestamp).await?;
replacement in pijul/src/commands/tag.rs at line 214
− super::pager(repo.config.pager.as_ref());
edit in pijul/src/commands/tag.rs at line 235
+ config: &pijul_config::Config,
replacement in pijul/src/commands/tag.rs at line 245
[20.13668]→[20.721:788](∅→∅),
[20.788]→[20.157:250](∅→∅) − } else if let Some(_dir) = pijul_config::global_config_dir() {
− let k = pijul_identity::public_key(&pijul_identity::choose_identity_name().await?)?;
+ } else {
+ let identity_name = pijul_identity::choose_identity_name(config).await?;
+ let k = pijul_identity::public_key(&identity_name)?;
replacement in pijul/src/commands/status.rs at line 27
[20.1186]→[20.1186:1238](∅→∅) − pub fn run(self) -> Result<(), anyhow::Error> {
+ pub fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
replacement in pijul/src/commands/status.rs at line 58
[20.448]→[20.1584:1603](∅→∅),
[20.1584]→[20.1584:1603](∅→∅) replacement in pijul/src/commands/reset.rs at line 35
[20.98112]→[20.1134:1186](∅→∅),
[20.1186]→[6.0:68](∅→∅),
[6.68]→[20.203:353](∅→∅),
[20.203]→[20.203:353](∅→∅) − pub fn run(self) -> Result<(), anyhow::Error> {
− let reset_overwrites_changes = pijul_config::Global::load()
− .ok()
− .and_then(|c| c.0.reset_overwrites_changes);
−
− let overwrite_changes = match reset_overwrites_changes.as_ref() {
+ pub fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
+ let overwrite_changes = match config.reset_overwrites_changes.as_ref() {
replacement in pijul/src/commands/record.rs at line 63
[20.102774]→[20.478:536](∅→∅) − pub async fn run(self) -> Result<(), anyhow::Error> {
+ pub async fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
replacement in pijul/src/commands/record.rs at line 68
[20.102992]→[20.91:142](∅→∅) − for h in repo.config.hooks.record.iter() {
+ for h in config.hooks.record.iter() {
replacement in pijul/src/commands/record.rs at line 79
[14.407]→[14.407:468](∅→∅) − for h in repo.config.extra_dependencies.iter() {
+ for h in config.extra_dependencies.iter() {
replacement in pijul/src/commands/record.rs at line 126
[20.104017]→[20.537:570](∅→∅) + self.header(config).await?
replacement in pijul/src/commands/record.rs at line 140
− pijul_identity::Complete::load(&pijul_identity::choose_identity_name().await?)?;
+ pijul_identity::Complete::load(&pijul_identity::choose_identity_name(config).await?)?;
replacement in pijul/src/commands/record.rs at line 142
[20.169]→[20.169:216](∅→∅) − let (secret, _) = complete.decrypt()?;
+ let (secret, _) = complete.decrypt(config)?;
replacement in pijul/src/commands/record.rs at line 204
[20.105380]→[20.728:796](∅→∅),
[20.796]→[20.789:840](∅→∅) − async fn header(&self) -> Result<ChangeHeader, anyhow::Error> {
− let config = pijul_config::Global::load();
+ async fn header(&self, config: &pijul_config::Config) -> Result<ChangeHeader, anyhow::Error> {
replacement in pijul/src/commands/record.rs at line 213
[20.387]→[20.387:462](∅→∅) − .unwrap_or(pijul_identity::choose_identity_name().await?);
+ .unwrap_or(pijul_identity::choose_identity_name(config).await?);
replacement in pijul/src/commands/record.rs at line 220
[20.14464]→[20.14464:14592](∅→∅) − let templates = config
− .as_ref()
− .ok()
− .and_then(|(cfg, _)| cfg.template.as_ref());
+ let templates = config.template.as_ref();
replacement in pijul/src/commands/pushpull.rs at line 17
[20.1759]→[9.445:497](∅→∅) − use pijul_config::{RemoteConfig, RemoteHttpHeader};
+ use pijul_config::remote::{RemoteConfig, RemoteHttpHeader};
replacement in pijul/src/commands/pushpull.rs at line 72
[9.1535]→[9.1535:1629](∅→∅) − fn aggregate_remote_info<T>(repo: &Repository, txn: &T) -> Result<RemoteInfos, anyhow::Error>
+ fn aggregate_remote_info<T>(
+ config: &pijul_config::Config,
+ txn: &T,
+ ) -> Result<RemoteInfos, anyhow::Error>
replacement in pijul/src/commands/pushpull.rs at line 85
[20.473]→[9.1839:1876](∅→∅) − for rc in &repo.config.remotes {
+ for rc in &config.remotes {
replacement in pijul/src/commands/pushpull.rs at line 149
[20.859]→[9.3607:3664](∅→∅) − if let Some(default) = &repo.config.default_remote {
+ if let Some(default) = &config.default_remote {
replacement in pijul/src/commands/pushpull.rs at line 185
[20.112203]→[20.1423:1475](∅→∅) − pub fn run(self) -> Result<(), anyhow::Error> {
+ pub fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
replacement in pijul/src/commands/pushpull.rs at line 187
[11.215]→[20.112314:112351](∅→∅),
[20.1710]→[20.112314:112351](∅→∅),
[20.6541]→[20.112314:112351](∅→∅),
[20.10395]→[20.112314:112351](∅→∅),
[20.14652]→[20.112314:112351](∅→∅),
[20.112314]→[20.112314:112351](∅→∅) − debug!("{:?}", repo.config);
+ debug!("{:?}", config);
replacement in pijul/src/commands/pushpull.rs at line 192
[20.112523]→[9.4486:4558](∅→∅) − let remote_infos = aggregate_remote_info(&repo, &txn)?;
+ let remote_infos = aggregate_remote_info(config, &txn)?;
replacement in pijul/src/commands/pushpull.rs at line 269
[20.503]→[20.503:638](∅→∅) − let mut repo = repo;
− repo.config.default_remote = Some(remote);
− repo.update_config()?;
+ if let Some(mut local_config) = config.local() {
+ local_config.default_remote = Some(remote);
+ local_config.write()?;
+ }
edit in pijul/src/commands/pushpull.rs at line 279
[9.7290]→[20.1177:1214](∅→∅),
[20.112712]→[20.1177:1214](∅→∅) replacement in pijul/src/commands/pushpull.rs at line 281
[9.7292]→[9.7292:7358](∅→∅) − let db = aggregate_remote_info(&repo, &mut txn)?;
+ let db = aggregate_remote_info(config, &mut txn)?;
replacement in pijul/src/commands/pushpull.rs at line 294
[20.1376]→[9.7783:7924](∅→∅) − fn remove_named_repo(repo: &mut Repository, name: &str) {
− let idx = repo
− .config
+ fn remove_named_remote(local_config: &mut pijul_config::local::Local, name: &str) {
+ let idx = local_config
replacement in pijul/src/commands/pushpull.rs at line 300
[9.8080]→[9.8080:8133](∅→∅) − repo.config.remotes.remove(idx);
+ local_config.remotes.remove(idx);
replacement in pijul/src/commands/pushpull.rs at line 307
[9.8269]→[9.8269:8312](∅→∅) + local_config: &mut pijul_config::local::Local,
replacement in pijul/src/commands/pushpull.rs at line 328
[9.8995]→[9.8995:9050](∅→∅) − remove_named_repo(repo, name);
+ remove_named_remote(local_config, name);
replacement in pijul/src/commands/pushpull.rs at line 337
[9.9258]→[9.9258:9317](∅→∅) − repo.config.default_remote = None;
+ local_config.default_remote = None;
edit in pijul/src/commands/pushpull.rs at line 343
+ let mut local_config = config.local().unwrap();
replacement in pijul/src/commands/pushpull.rs at line 345
[9.9413]→[9.9413:9486](∅→∅) − flood_delete(flood, exact, d, &mut repo, &mut txn)?;
+ flood_delete(flood, exact, d, &mut local_config, &mut txn)?;
replacement in pijul/src/commands/pushpull.rs at line 351
[9.9745]→[9.9745:9826](∅→∅) − flood_delete(flood, exact, d, &mut repo, &mut txn)?;
+ flood_delete(flood, exact, d, &mut local_config, &mut txn)?;
replacement in pijul/src/commands/pushpull.rs at line 353
[9.9859]→[9.9859:9942](∅→∅) − let idx = repo
− .config
replacement in pijul/src/commands/pushpull.rs at line 358
[9.10130]→[9.10130:10191](∅→∅) − repo.config.remotes.remove(idx);
+ local_config.remotes.remove(idx);
replacement in pijul/src/commands/pushpull.rs at line 361
[9.10263]→[9.10263:10330](∅→∅) − repo.config.default_remote = None;
+ local_config.default_remote = None;
replacement in pijul/src/commands/pushpull.rs at line 366
[9.10518]→[9.10518:10599](∅→∅) − flood_delete(flood, exact, d, &mut repo, &mut txn)?;
+ flood_delete(flood, exact, d, &mut local_config, &mut txn)?;
replacement in pijul/src/commands/pushpull.rs at line 392
[9.11390]→[9.11390:11467](∅→∅) − flood_delete(flood, exact, d, &mut repo, &mut txn)?;
+ flood_delete(flood, exact, d, &mut local_config, &mut txn)?;
replacement in pijul/src/commands/pushpull.rs at line 397
[20.1658]→[20.1658:1697](∅→∅) replacement in pijul/src/commands/pushpull.rs at line 504
[20.20067]→[20.114453:114511](∅→∅),
[20.114453]→[20.114453:114511](∅→∅) − pub async fn run(self) -> Result<(), anyhow::Error> {
+ pub async fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
edit in pijul/src/commands/pushpull.rs at line 507
[20.212]→[20.114570:114607](∅→∅),
[11.366]→[20.114570:114607](∅→∅),
[20.1781]→[20.114570:114607](∅→∅),
[20.4329]→[20.114570:114607](∅→∅),
[20.6659]→[20.114570:114607](∅→∅),
[20.10461]→[20.114570:114607](∅→∅),
[20.15285]→[20.114570:114607](∅→∅),
[20.20135]→[20.114570:114607](∅→∅),
[20.114570]→[20.114570:114607](∅→∅) − debug!("{:?}", repo.config);
replacement in pijul/src/commands/pushpull.rs at line 513
[20.114765]→[20.114765:114832](∅→∅) − } else if let Some(ref def) = repo.config.default_remote {
+ } else if let Some(ref def) = config.default_remote {
replacement in pijul/src/commands/pushpull.rs at line 533
[20.1201]→[20.1201:1220](∅→∅) replacement in pijul/src/commands/pushpull.rs at line 689
[20.21786]→[20.117527:117585](∅→∅),
[20.117527]→[20.117527:117585](∅→∅) − pub async fn run(self) -> Result<(), anyhow::Error> {
+ pub async fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
edit in pijul/src/commands/pushpull.rs at line 700
[20.2459]→[20.117853:117890](∅→∅),
[20.9332]→[20.117853:117890](∅→∅),
[20.117853]→[20.117853:117890](∅→∅) − debug!("{:?}", repo.config);
replacement in pijul/src/commands/pushpull.rs at line 702
[20.117967]→[20.117967:118034](∅→∅) − } else if let Some(ref def) = repo.config.default_remote {
+ } else if let Some(ref def) = config.default_remote {
replacement in pijul/src/commands/pushpull.rs at line 712
[20.1445]→[20.1445:1464](∅→∅) replacement in pijul/src/commands/mod.rs at line 141
[20.13]→[20.841:977](∅→∅) − fn pager(repo_config_pager: Option<&pijul_config::Choice>) -> bool {
− if let Some(pijul_config::Choice::Never) = repo_config_pager {
+ fn pager(config: &pijul_config::Config) -> bool {
+ if let Some(pijul_config::Choice::Never) = config.pager {
edit in pijul/src/commands/mod.rs at line 144
[20.568]→[20.978:1061](∅→∅),
[20.1061]→[20.653:713](∅→∅),
[20.653]→[20.653:713](∅→∅),
[20.713]→[20.119:125](∅→∅),
[20.119]→[20.119:125](∅→∅),
[20.125]→[20.714:736](∅→∅) − } else if let Some(pijul_config::Choice::Never) = pijul_config::Global::load()
− .ok()
− .and_then(|(global, _)| global.pager)
− {
− return false;
replacement in pijul/src/commands/log.rs at line 501
[20.3949]→[20.14212:14264](∅→∅),
[20.14212]→[20.14212:14264](∅→∅) − pub fn run(self) -> Result<(), anyhow::Error> {
+ pub fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
replacement in pijul/src/commands/log.rs at line 505
[20.2247]→[20.2247:2306](∅→∅) − super::pager(log_iter.repo.config.pager.as_ref());
replacement in pijul/src/commands/init.rs at line 24
[20.136770]→[20.1772:1824](∅→∅),
[20.1824]→[20.2023:2111](∅→∅) − pub fn run(self) -> Result<(), anyhow::Error> {
− let repo = Repository::init(self.path.as_deref(), self.kind.as_deref(), None)?;
+ pub fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
+ let repo = Repository::init(config, self.path.as_deref(), self.kind.as_deref(), None)?;
replacement in pijul/src/commands/identity.rs at line 2
[20.1946]→[20.1210:1254](∅→∅),
[20.2059]→[20.1210:1254](∅→∅),
[20.1210]→[20.1210:1254](∅→∅) − use pijul_config::{self as config, Author};
+ use pijul_config::author::Author;
+ use pijul_config::global::Global;
edit in pijul/src/commands/identity.rs at line 193
+ config: &pijul_config::Config,
replacement in pijul/src/commands/identity.rs at line 205
[20.47572]→[20.2817:2865](∅→∅) − pijul_interaction::Password::new()?
+ pijul_interaction::Password::new(config)?
replacement in pijul/src/commands/identity.rs at line 223
[20.17001]→[20.17001:17028](∅→∅) + identity::IdentityConfig {
replacement in pijul/src/commands/identity.rs at line 239
[20.48506]→[20.48506:48564](∅→∅) − pub async fn run(self) -> Result<(), anyhow::Error> {
+ pub async fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
replacement in pijul/src/commands/identity.rs at line 245
[20.150]→[20.150:192](∅→∅) + config,
+ Complete::default(config)?,
replacement in pijul/src/commands/identity.rs at line 256
[20.49307]→[20.1080:1138](∅→∅) − identity.create(!options.no_link).await?;
+ identity.create(config, !options.no_link).await?;
replacement in pijul/src/commands/identity.rs at line 258
[20.1972]→[20.1972:2063](∅→∅) − if let Err(_) = remote::prove(&identity, None, self.no_cert_check).await {
+ if let Err(_) = remote::prove(config, &identity, None, self.no_cert_check).await {
replacement in pijul/src/commands/identity.rs at line 267
[20.49398]→[20.1139:1198](∅→∅) − SubCommand::Repair => fix_identities().await?,
+ SubCommand::Repair => fix_identities(config).await?,
replacement in pijul/src/commands/identity.rs at line 272
[20.49589]→[20.1199:1292](∅→∅) − let identity_name = &identity_name.unwrap_or(choose_identity_name().await?);
+ let identity_name = &identity_name.unwrap_or(choose_identity_name(config).await?);
replacement in pijul/src/commands/identity.rs at line 274
[20.2726]→[20.2726:2821](∅→∅) − remote::prove(&loaded_identity, server.as_deref(), self.no_cert_check).await?;
+ remote::prove(
+ config,
+ &loaded_identity,
+ server.as_deref(),
+ self.no_cert_check,
+ )
+ .await?;
replacement in pijul/src/commands/identity.rs at line 395
[20.54509]→[20.1293:1343](∅→∅) − choose_identity_name().await?
+ choose_identity_name(config).await?
edit in pijul/src/commands/identity.rs at line 401
replacement in pijul/src/commands/identity.rs at line 416
[20.1054]→[20.2866:2957](∅→∅) − .prompt_changes(Some(old_identity.name.clone()), !options.no_link)
+ .prompt_changes(config, Some(old_identity.name.clone()), !options.no_link)
replacement in pijul/src/commands/identity.rs at line 430
[20.3303]→[20.3303:3393](∅→∅) − remote::prove(&new_identity, None, self.no_cert_check).await;
+ remote::prove(config, &new_identity, None, self.no_cert_check).await;
replacement in pijul/src/commands/identity.rs at line 456
[20.1375]→[20.1375:1469](∅→∅),
[20.1469]→[20.56019:56074](∅→∅),
[20.56019]→[20.56019:56074](∅→∅) − Complete::load(&identity_name.unwrap_or(choose_identity_name().await?))?;
− let path = config::global_config_dir()
+ Complete::load(&identity_name.unwrap_or(choose_identity_name(config).await?))?;
+ let path = Global::config_file()
+ .unwrap()
+ .parent()
replacement in pijul/src/commands/identity.rs at line 468
[20.56342]→[20.2958:2998](∅→∅) + && !Confirm::new(config)?
edit in pijul/src/commands/fork.rs at line 3
[20.73]→[20.2351:2367](∅→∅),
[20.4126]→[20.2351:2367](∅→∅),
[20.167976]→[20.2351:2367](∅→∅) edit in pijul/src/commands/fork.rs at line 28
[15.207]→[20.168420:168457](∅→∅),
[20.2182]→[20.168420:168457](∅→∅),
[20.13203]→[20.168420:168457](∅→∅),
[20.14697]→[20.168420:168457](∅→∅),
[20.23738]→[20.168420:168457](∅→∅),
[20.168420]→[20.168420:168457](∅→∅) − debug!("{:?}", repo.config);
replacement in pijul/src/commands/diff.rs at line 42
[20.174051]→[20.2143:2199](∅→∅) − pub fn run(mut self) -> Result<(), anyhow::Error> {
+ pub fn run(mut self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
replacement in pijul/src/commands/diff.rs at line 141
[20.175777]→[20.2700:2761](∅→∅) − let colors = is_colored(repo.config.pager.as_ref());
+ let colors = is_colored(config);
replacement in pijul/src/commands/diff.rs at line 346
[20.400]→[20.1255:1333](∅→∅) − pub fn is_colored(repo_config_pager: Option<&pijul_config::Choice>) -> bool {
+ pub fn is_colored(config: &pijul_config::Config) -> bool {
replacement in pijul/src/commands/diff.rs at line 348
[7.89]→[20.1334:1394](∅→∅),
[20.483]→[20.1334:1394](∅→∅),
[20.1394]→[20.539:569](∅→∅),
[20.24132]→[20.539:569](∅→∅),
[20.539]→[20.539:569](∅→∅),
[20.569]→[20.1395:1525](∅→∅),
[20.1525]→[20.701:760](∅→∅),
[20.701]→[20.701:760](∅→∅),
[20.760]→[20.1526:1591](∅→∅),
[20.1591]→[20.826:845](∅→∅),
[20.826]→[20.826:845](∅→∅),
[20.845]→[20.2842:2891](∅→∅),
[20.2891]→[20.877:891](∅→∅),
[20.877]→[20.877:891](∅→∅) − if let Ok((global, _)) = pijul_config::Global::load() {
− match global.colors {
− Some(pijul_config::Choice::Always) => colors = true,
− Some(pijul_config::Choice::Never) => colors = false,
− _ => {}
− }
− match global.pager {
− Some(pijul_config::Choice::Never) => colors = false,
− _ => {
− super::pager(repo_config_pager);
− }
+ match config.colors {
+ Some(pijul_config::Choice::Always) => colors = true,
+ Some(pijul_config::Choice::Never) => colors = false,
+ _ => {}
+ }
+ match config.pager {
+ Some(pijul_config::Choice::Never) => colors = false,
+ _ => {
+ super::pager(config);
edit in pijul/src/commands/diff.rs at line 358
[20.2096]→[20.892:905](∅→∅),
[20.905]→[20.2892:2943](∅→∅) − } else {
− colors &= super::pager(repo_config_pager);
replacement in pijul/src/commands/credit.rs at line 25
[20.179133]→[20.2253:2305](∅→∅) − pub fn run(self) -> Result<(), anyhow::Error> {
+ pub fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
replacement in pijul/src/commands/credit.rs at line 45
[20.309]→[20.309:359](∅→∅) − super::pager(repo.config.pager.as_ref());
replacement in pijul/src/commands/clone.rs at line 37
[20.183813]→[20.183813:183871](∅→∅) − pub async fn run(self) -> Result<(), anyhow::Error> {
+ pub async fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
edit in pijul/src/commands/clone.rs at line 39
replacement in pijul/src/commands/clone.rs at line 86
[20.321]→[20.2538:2625](∅→∅) − let mut repo = Repository::init(Some(&path), None, Some(&remote_normalised))?;
+ let mut repo = Repository::init(config, Some(&path), None, Some(&remote_normalised))?;
replacement in pijul/src/commands/client.rs at line 5
[20.1966]→[20.548:548](∅→∅),
[20.548]→[20.1592:1629](∅→∅),
[20.2018]→[20.1592:1629](∅→∅) −
− use pijul_config::global_config_dir;
+ use pijul_config::global::Global;
replacement in pijul/src/commands/client.rs at line 23
[20.5116]→[20.5116:5172](∅→∅) − if let Some(mut cached) = global_config_dir() {
+ if let Some(mut cached) = Global::config_file() {
+ cached.pop();
replacement in pijul/src/commands/change.rs at line 20
[20.189681]→[20.2443:2495](∅→∅) − pub fn run(self) -> Result<(), anyhow::Error> {
+ pub fn run(self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
replacement in pijul/src/commands/change.rs at line 44
[4.49]→[20.2995:3069](∅→∅),
[20.190342]→[20.2995:3069](∅→∅) − let colors = super::diff::is_colored(repo.config.pager.as_ref());
+ let colors = super::diff::is_colored(config);
replacement in pijul/src/commands/archive.rs at line 40
[20.191803]→[20.8232:8294](∅→∅) − pub async fn run(mut self) -> Result<(), anyhow::Error> {
+ pub async fn run(mut self, config: &pijul_config::Config) -> Result<(), anyhow::Error> {
edit in pijul/src/commands/archive.rs at line 76