.pijul/config: simplify remotes and hooks

[?]
Nov 26, 2020, 9:14 PM
SEWGHUHQEEBJR7UPG3PSU7DSM376R43QEYENAZK325W46DCFMXKAC

Dependencies

  • [2] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [3] VQPAUKBQ channel switch as an alias to reset
  • [4] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [5] 4H2XTVJ2 Fix some mistakes in the docs
  • [6] I52XSRUH Massive cleanup, and simplification

Change contents

  • edit in pijul/src/config.rs at line 46
    [2.91124]
    [2.91124]
    #[serde(default)]
  • replacement in pijul/src/config.rs at line 48
    [2.91166][2.91166:91196]()
    pub hooks: Option<Hooks>,
    [2.91166]
    [2.91196]
    #[serde(default)]
    pub hooks: Hooks,
  • edit in pijul/src/config.rs at line 54
    [2.91268]
    [2.91268]
    #[serde(default)]
  • replacement in pijul/src/commands/record.rs at line 55
    [2.102992][2.102992:103521]()
    if let Some(ref hooks) = repo.config.hooks {
    for h in hooks.record.iter() {
    let mut proc = std::process::Command::new("bash")
    .current_dir(&repo.path)
    .args(&["-c", &h])
    .spawn()?;
    let status = proc.wait()?;
    if !status.success() {
    writeln!(stderr, "Hook {:?} exited with code {:?}", h, status)?;
    std::process::exit(status.code().unwrap_or(1))
    }
    [2.102992]
    [2.103521]
    for h in repo.config.hooks.record.iter() {
    let mut proc = std::process::Command::new("bash")
    .current_dir(&repo.path)
    .args(&["-c", &h])
    .spawn()?;
    let status = proc.wait()?;
    if !status.success() {
    writeln!(stderr, "Hook {:?} exited with code {:?}", h, status)?;
    std::process::exit(status.code().unwrap_or(1))