Add hunk paths to log ouput
Dependencies
- [2]
NAUECZW3Fixing the map between keys and identities - [3]
UAXGGNAZImprove command feedback - [4]
WFBYDQB4fixing log --description - [5]
7P7G4J5ZParse argument of `pijul log --output-format` strictly - [6]
AEPEFS7OWrite help for each argument - [7]
U6TQX5Z2pager function respects cli option and user config files, PAGER env var - [8]
F2S6XETOFixing log --hash-only - [9]
6U42MTEZFixing log -- filters, along with performance improvements - [10]
5E2AB2YLFixing a conflict - [11]
OU6JOR3CAdd path filtering for log, add json output for log - [12]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [*]
RUBBHYZ7Removing unnecessary async/await - [*]
6F6AAHK4Simplifying pijul::commands::log, and fixing Broken Pipe errors
Change contents
- replacement in pijul/src/commands/log.rs at line 30
#[clap(long = "hash-only")]#[clap(long = "hash-only", conflicts_with = "files")] - edit in pijul/src/commands/log.rs at line 38
/// Include files changed in the output#[clap(long = "files")]files: bool, - edit in pijul/src/commands/log.rs at line 86[15.1491][2.243]
let show_paths = cmd.files; - edit in pijul/src/commands/log.rs at line 96[15.1672][15.1672]
show_paths, - edit in pijul/src/commands/log.rs at line 199
#[serde(skip_serializing_if = "Option::is_none")]paths: Option<Vec<String>>, - edit in pijul/src/commands/log.rs at line 216
paths, - edit in pijul/src/commands/log.rs at line 248
if let Some(ref paths) = paths {writeln!(f, " Files:")?;for path in paths {writeln!(f, " - {}", path)?;}writeln!(f)?;} - edit in pijul/src/commands/log.rs at line 285
show_paths: bool, - replacement in pijul/src/commands/log.rs at line 337
let mut reverse_log = self.txn.reverse_log(&*self.channel_ref.read(), None)?.peekable();let mut reverse_log = self.txn.reverse_log(&*self.channel_ref.read(), None)?.peekable(); - edit in pijul/src/commands/log.rs at line 393
let paths = if self.show_paths {let files = self.repo.changes.get_changes(&h)?;let mut paths: Vec<String> = files.into_iter().map(|hunk| hunk.path().to_string()).collect();paths.dedup();Some(paths)} else {None}; - replacement in pijul/src/commands/log.rs at line 473
description: if self.cmd.descriptions { header.description } else { None },description: if self.cmd.descriptions {header.description} else {None},paths, - replacement in pijul/src/commands/log.rs at line 502
OutputFormat::Json => {serde_json::to_writer_pretty(&mut stdout, &log_iter)?OutputFormat::Json => serde_json::to_writer_pretty(&mut stdout, &log_iter)?,OutputFormat::Plaintext => {log_iter.for_each(|entry| match write!(&mut stdout, "{}", entry) {Ok(_) => Ok(()),Err(e) if e.kind() == std::io::ErrorKind::BrokenPipe => Ok(()),Err(e) => Err(e),})? - edit in pijul/src/commands/log.rs at line 510
OutputFormat::Plaintext => log_iter.for_each(|entry| match write!(&mut stdout, "{}", entry) {Ok(_) => Ok(()),Err(e) if e.kind() == std::io::ErrorKind::BrokenPipe => Ok(()),Err(e) => Err(e),})?,