From 132dfd30e29bb2850edbfa7776eea3879af716ab Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Sun, 4 Aug 2024 14:55:31 -0700 Subject: [PATCH] describe: warn user of limitations when describing multiple commits I think it might be nice to have this in the upcoming release, but I'd like to warn people that their changes will be lost if they aren't careful, and to not rely on the syntax being fixed just yet. --- cli/src/description_util.rs | 7 +++++-- cli/tests/test_describe_command.rs | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cli/src/description_util.rs b/cli/src/description_util.rs index 4791bb95b..1c3663c9b 100644 --- a/cli/src/description_util.rs +++ b/cli/src/description_util.rs @@ -64,8 +64,11 @@ pub fn edit_multiple_descriptions( let mut bulk_message = String::new(); bulk_message.push_str(indoc! {r#" - JJ: Enter or edit commit descriptions after the `JJ: describe` lines. - + JJ: Enter or edit commit descriptions after the `JJ: describe` lines. + JJ: Warning: + JJ: - The text you enter will be lost on a syntax error. + JJ: - The syntax of the separator lines may change in the future. + "#}); for (commit_id, temp_commit) in commits.iter() { let commit_hash = short_commit_hash(commit_id); diff --git a/cli/tests/test_describe_command.rs b/cli/tests/test_describe_command.rs index a61fdf5d0..9a0128776 100644 --- a/cli/tests/test_describe_command.rs +++ b/cli/tests/test_describe_command.rs @@ -224,6 +224,9 @@ fn test_describe_multiple_commits() { insta::assert_snapshot!( std::fs::read_to_string(test_env.env_root().join("editor0")).unwrap(), @r###" JJ: Enter or edit commit descriptions after the `JJ: describe` lines. + JJ: Warning: + JJ: - The text you enter will be lost on a syntax error. + JJ: - The syntax of the separator lines may change in the future. JJ: describe 8d650510daad ------- @@ -238,6 +241,10 @@ fn test_describe_multiple_commits() { &edit_script, indoc! {" write + JJ: Enter or edit commit descriptions after the `JJ: describe` lines. + + JJ: More header tests. Library tests verify parsing in other situations. + JJ: describe 8d650510daad ------- description from editor of @-