Fixing the map between keys and identities

pmeunier
Jan 1, 2022, 6:32 PM
NAUECZW353R5RHT4GGQJIEZPA5EYRGQYTSP7IJNBJS3CXBSTNJDQC

Dependencies

  • [2] 6U42MTEZ Fixing log -- filters, along with performance improvements
  • [3] EEBKW7VT Keys and identities
  • [4] F2S6XETO Fixing log --hash-only
  • [5] CXSCA5HN Fixing a counter-intuitive error when a local repo does not exist
  • [6] OU243LAB Support for staging
  • [7] SMMBFECL Converting to the new patch format "online"
  • [8] A3RM526Y Integrating identity malleability
  • [9] E7UUQQCC Apply changes with prefixes in .pijul/changes
  • [10] OU6JOR3C Add path filtering for log, add json output for log
  • [11] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [12] I24UEJQL Various post-fire fixes
  • [*] I52XSRUH Massive cleanup, and simplification
  • [*] 6F6AAHK4 Simplifying pijul::commands::log, and fixing Broken Pipe errors

Change contents

  • replacement in pijul/src/commands/record.rs at line 142
    [3.1069][3.13979:14017]()
    let key = super::load_key()?;
    [3.1069]
    [3.1910]
    let (_, key) = super::load_key()?;
  • edit in pijul/src/commands/mod.rs at line 263
    [3.20197]
    [3.20197]
    #[serde(default)]
  • replacement in pijul/src/commands/mod.rs at line 267
    [3.20228][3.20228:20290]()
    fn load_key() -> Result<libpijul::key::SKey, anyhow::Error> {
    [3.20228]
    [3.20290]
    fn load_key() -> Result<(libpijul::key::SecretKey, libpijul::key::SKey), anyhow::Error> {
  • replacement in pijul/src/commands/mod.rs at line 280
    [3.20787][3.20787:20828]()
    Ok(k.load(pass.as_deref())?)
    [3.20787]
    [3.20828]
    let sk = k.load(pass.as_deref())?;
    Ok((k, sk))
  • edit in pijul/src/commands/log.rs at line 15
    [14.3396]
    [3.225]
    use log::*;
  • edit in pijul/src/commands/log.rs at line 85
    [15.1491]
    [15.1491]
    let mut global_id_path = crate::config::global_config_dir();
    if let Some(ref mut gl) = global_id_path {
    gl.push("identities")
    }
    debug!("global_id_path = {:?}", global_id_path);
  • edit in pijul/src/commands/log.rs at line 98
    [15.1608]
    [15.1608]
    global_id_path,
  • edit in pijul/src/commands/log.rs at line 277
    [3.7422]
    [3.7422]
    global_id_path: Option<PathBuf>,
  • edit in pijul/src/commands/log.rs at line 325
    [3.10385]
    [3.10385]
  • edit in pijul/src/commands/log.rs at line 327
    [3.10433]
    [3.10702]
    let mut global_id_path = self.global_id_path.clone();
  • replacement in pijul/src/commands/log.rs at line 348
    [2.1350][2.1350:1482]()
    let entry =
    self.mk_log_entry(&mut authors, &mut id_path, h.into(), Some(mrk.into()))?;
    [2.1350]
    [2.1482]
    let entry = self.mk_log_entry(
    &mut authors,
    &mut id_path,
    &mut global_id_path,
    h.into(),
    Some(mrk.into()),
    )?;
  • edit in pijul/src/commands/log.rs at line 376
    [3.12405]
    [3.12405]
    global_id_path: &mut Option<PathBuf>,
  • replacement in pijul/src/commands/log.rs at line 394
    [3.12994][3.12994:13074]()
    if let Ok(f) = std::fs::File::open(&self.id_path) {
    [3.12994]
    [3.13074]
    if let Ok(f) = std::fs::File::open(&id_path) {
  • edit in pijul/src/commands/log.rs at line 400
    [3.13299]
    [3.13299]
    debug!("{:?} {:?}", global_id_path, id);
    if let Some(ref mut global_id_path) = global_id_path {
    if id.is_none() {
    global_id_path.push(e.key());
    debug!("{:?}", global_id_path);
    if let Ok(f) = std::fs::File::open(&global_id_path) {
    if let Ok(id_) = serde_json::from_reader(f) {
    id = Some(id_)
    } else {
    debug!("wrong identity for {:?}", e.key());
    }
    }
    global_id_path.pop();
    }
    }
  • replacement in pijul/src/commands/log.rs at line 417
    [3.13350][3.13350:13401]()
    e.insert(id.login)
    [3.13350]
    [3.13401]
    if let Some(ref name) = id.name {
    if let Some(ref email) = id.email {
    e.insert(format!("{} ({}) <{}>", name, id.login, email))
    } else {
    e.insert(format!("{} ({})", name, id.login))
    }
    } else {
    e.insert(id.login)
    }
  • replacement in pijul/src/commands/key.rs at line 118
    [3.23576][3.23576:23622]()
    let key = super::load_key()?;
    [3.23576]
    [3.23622]
    let (_, key) = super::load_key()?;