give Comment a timestamp, display in chronological order

This commit makes a couple of changes:

- `ent show ISSUE` now displays the Issue's Comments in chronological
  order

- the Comment struct now includes a timestamp, which is the Author Time
  of the oldest commit that touches the comment's directory

- the Issue struct now stores its Comments in a sorted Vec, not in
  a HashMap

- The Comment's uuid moved into the Comment struct itself, instead of
  being the key in the Issue's HashMap of Comments
This commit is contained in:
Sebastian Kuzminsky 2025-07-07 23:45:03 -06:00
parent 431c67d43d
commit be362517fb
6 changed files with 65 additions and 23 deletions

View file

@ -112,9 +112,10 @@ fn handle_command(args: &Args, issues_dir: &std::path::Path) -> anyhow::Result<(
}
println!("");
println!("{}", issue.description);
for (uuid, comment) in issue.comments.iter() {
for comment in &issue.comments {
println!("");
println!("comment: {}", uuid);
println!("comment: {}", comment.uuid);
println!("timestamp: {}", comment.timestamp);
println!("{}", comment.description);
}
}