Make the default remote configurable through the cli

irevoire
Dec 3, 2022, 3:27 PM
QCPIBC6MDPFE42KWELKZQ3ORNEOPSBXR7C7H6Z3ZT62RNVBFN73QC

Dependencies

  • [2] H4AU6QRP New config for HTTP remotes
  • [3] KWAGWB73 Adding extra dependencies from the config file
  • [4] ZSFJT4SF Allow remotes to have a different push and pull address
  • [5] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [6] SEWGHUHQ .pijul/config: simplify remotes and hooks
  • [*] AEPEFS7O Write help for each argument

Change contents

  • edit in pijul/src/repository.rs at line 150
    [3.25358]
    [3.25358]
    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/src/config.rs at line 131
    [3.91124][3.0:22]()
    #[serde(default)]
    [3.91124]
    [3.22]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
  • replacement in pijul/src/config.rs at line 133
    [3.63][3.0:22](),[3.91124][3.0:22]()
    #[serde(default)]
    [3.63]
    [2.3591]
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
  • edit in pijul/src/commands/pushpull.rs at line 31
    [3.112089]
    [8.1500]
    /// Set the default remote
    #[clap(name = "default")]
    Default { remote: String },
  • edit in pijul/src/commands/pushpull.rs at line 51
    [3.112646]
    [3.112646]
    }
    Some(SubRemote::Default { remote }) => {
    let mut repo = repo;
    repo.config.default_remote = Some(remote);
    repo.update_config()?;