Skip to content

Commit

Permalink
op diff: remove redundant "Change {change_id}" from changed commits g…
Browse files Browse the repository at this point in the history
…raph

This makes the graph compact. Short change ids are usually printed as a part
of commit summary. The --no-graph output is a bit harder to parse, but we can
still discriminate entries by change ids.
  • Loading branch information
yuja committed Jan 11, 2025
1 parent 4ef8ad8 commit 8e5a18b
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 176 deletions.
5 changes: 0 additions & 5 deletions cli/src/commands/operation/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ use jj_lib::repo::Repo;
use jj_lib::revset;
use jj_lib::revset::RevsetIteratorExt as _;

use crate::cli_util::short_change_hash;
use crate::cli_util::CommandHelper;
use crate::cli_util::LogContentFormat;
use crate::command_error::CommandError;
Expand Down Expand Up @@ -239,7 +238,6 @@ pub fn show_op_diff(
write_modified_change_summary(
formatter,
commit_summary_template,
&change_id,
modified_change,
)
})?;
Expand Down Expand Up @@ -273,7 +271,6 @@ pub fn show_op_diff(
write_modified_change_summary(
formatter,
commit_summary_template,
&change_id,
modified_change,
)
})?;
Expand Down Expand Up @@ -394,10 +391,8 @@ pub fn show_op_diff(
fn write_modified_change_summary(
formatter: &mut dyn Formatter,
commit_summary_template: &TemplateRenderer<Commit>,
change_id: &ChangeId,
modified_change: &ModifiedChange,
) -> Result<(), std::io::Error> {
writeln!(formatter, "Change {}", short_change_hash(change_id))?;
for commit in &modified_change.added_commits {
formatter.with_label("diff", |formatter| write!(formatter.labeled("added"), "+"))?;
write!(formatter, " ")?;
Expand Down
Loading

0 comments on commit 8e5a18b

Please sign in to comment.