Skip to content

Commit

Permalink
log: Fix --show=c (command without merge)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentdephily committed Nov 5, 2024
1 parent 5220495 commit 0e1b97e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,21 @@ pub fn cmd_log(gc: Conf, sc: ConfLog) -> Result<bool, Error> {
}
},
Hist::MergeStart { ts, key, nth, of, .. } => {
// This'll overwrite any previous entry, if a merge started but never finished
merges.insert(key, ts);
if sc.show.merge {
// This'll overwrite any previous entry, if a merge started but never finished
merges.insert(key, ts);
}
update_cmd(&mut cmds, nth, of);
},
Hist::MergeStop { ts, ref key, .. } => {
found += 1;
let started = merges.remove(key).unwrap_or(ts + 1);
if found <= sc.first {
tbl.row([&[&FmtDate(if sc.starttime { started } else { ts })],
&[&FmtDur(ts - started)],
&[&gc.merge, &p.ebuild_version()]]);
if sc.show.merge {
found += 1;
let started = merges.remove(key).unwrap_or(ts + 1);
if found <= sc.first {
tbl.row([&[&FmtDate(if sc.starttime { started } else { ts })],
&[&FmtDur(ts - started)],
&[&gc.merge, &p.ebuild_version()]]);
}
}
},
Hist::UnmergeStart { ts, key, .. } => {
Expand Down
2 changes: 1 addition & 1 deletion src/parse/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub fn get_hist(file: &str,
let filter = FilterStr::try_new(search_terms, search_exact)?;
let (tx, rx): (Sender<Hist>, Receiver<Hist>) = bounded(256);
thread::spawn(move || {
let show_merge = show.merge || show.pkg || show.tot;
let show_merge = show.merge || show.pkg || show.tot || show.cmd;
let show_unmerge = show.unmerge || show.pkg || show.tot;
let mut prev_t = 0;
let mut curline = 1;
Expand Down

0 comments on commit 0e1b97e

Please sign in to comment.