Default feedback for the `pijul git` command

pmeunier
Aug 4, 2021, 9:44 AM
YVA72CP2DB5XDKML3HR6NLB2GNPN5PXCGZD6DVXZGLAUEB3W4TGAC

Dependencies

  • [2] SNZ3OAMC use native external subcommand support instead of hand-rolled one
  • [3] SFY4U6XE remove redundant conditional compilation
  • [4] FMKKWCFV Better clap attributes
  • [5] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [6] JL4WKA5P Implement the Sanakirja concurrency model in a cross-process way
  • [7] WFXSB6RA Do not run `pijul git` if there are uncommitted changes
  • [8] IIV3EL2X Cleanup, formatting, and fixing the Git feature
  • [9] WXAFKN6J Do not call an external subcommand when the parsing of an existing subcommand fails
  • [10] RJMQSZER External commands
  • [11] MU3NL6MD Fixing `pijul git` with the new Sanakirja
  • [12] VGBH3ED6 The Git feature does not need to be async
  • [*] L4JXJHWX pijul/*: reorganize imports and remove extern crate

Change contents

  • edit in pijul/src/main.rs at line 13
    [4.31]
    [14.664]
    use env_logger::fmt::Color;
  • replacement in pijul/src/main.rs at line 142
    [3.20][5.88153:88177](),[5.88153][5.88153:88177](),[5.88177][2.99:100]()
    env_logger::init();
    [3.20]
    [2.100]
    env_logger_init();
  • edit in pijul/src/main.rs at line 156
    [5.860]
    [5.860]
    }
    fn env_logger_init() {
    let mut builder = env_logger::builder();
    builder.filter(Some("pijul::commands::git"), log::LevelFilter::Info);
    builder.format(|buf, record| {
    let target = record.metadata().target();
    if target == "pijul::commands::git" {
    let mut level_style = buf.style();
    level_style.set_color(Color::Green);
    writeln!(
    buf,
    "{} {}",
    level_style.value(record.level()),
    record.args()
    )
    } else {
    let mut level_style = buf.style();
    level_style.set_color(Color::Black).set_intense(true);
    let op = level_style.value("[");
    let cl = level_style.value("]");
    writeln!(
    buf,
    "{}{} {} {}{} {}",
    op,
    buf.timestamp(),
    buf.default_styled_level(record.level()),
    target,
    cl,
    record.args()
    )
    }
    });
    builder.init();
  • replacement in pijul/src/commands/git.rs at line 68
    [5.138368][5.138368:138405]()
    info!("Loading history…");
    [5.138368]
    [5.138405]
    info!("Loading Git history…");
  • replacement in pijul/src/commands/git.rs at line 77
    [5.138753][5.138753:138776]()
    info!("Done");
    [5.138753]
    [5.138776]
    debug!("Done");