diff --git a/src/cli_util.rs b/src/cli_util.rs index c0a3c368a..d5f59f5b3 100644 --- a/src/cli_util.rs +++ b/src/cli_util.rs @@ -1422,10 +1422,10 @@ pub fn run_ui_editor(settings: &UserSettings, edit_path: &PathBuf) -> Result<(), pub fn short_commit_description(commit: &Commit) -> String { let first_line = commit.description().split('\n').next().unwrap(); format!( - "{} ({})", + "{} {}", short_commit_hash(commit.id()), if first_line.is_empty() { - "no description set" + "(no description set)" } else { first_line } diff --git a/tests/test_checkout.rs b/tests/test_checkout.rs index 0220ebaae..495d15b0c 100644 --- a/tests/test_checkout.rs +++ b/tests/test_checkout.rs @@ -67,10 +67,10 @@ fn test_checkout_not_single_rev() { Error: Revset "root..@" resolved to more than one revision Hint: The revset resolved to these revisions: 2f8593712db5 (no description set) - 5c1afd8b074f (fifth) - 009f88bf7141 (fourth) - 3fa8931e7b89 (third) - 5c52832c3483 (second) + 5c1afd8b074f fifth + 009f88bf7141 fourth + 3fa8931e7b89 third + 5c52832c3483 second ... "###); @@ -78,19 +78,19 @@ fn test_checkout_not_single_rev() { insta::assert_snapshot!(stderr, @r###" Error: Revset "root..@-" resolved to more than one revision Hint: The revset resolved to these revisions: - 5c1afd8b074f (fifth) - 009f88bf7141 (fourth) - 3fa8931e7b89 (third) - 5c52832c3483 (second) - 69542c1984c1 (first) + 5c1afd8b074f fifth + 009f88bf7141 fourth + 3fa8931e7b89 third + 5c52832c3483 second + 69542c1984c1 first "###); let stderr = test_env.jj_cmd_failure(&repo_path, &["checkout", "@-|@--"]); insta::assert_snapshot!(stderr, @r###" Error: Revset "@-|@--" resolved to more than one revision Hint: The revset resolved to these revisions: - 5c1afd8b074f (fifth) - 009f88bf7141 (fourth) + 5c1afd8b074f fifth + 009f88bf7141 fourth "###); let stderr = test_env.jj_cmd_failure(&repo_path, &["checkout", "none()"]);