From 672c7139d88eaef1ac4690d804d0698ea1f12e2d Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Sun, 4 Aug 2024 14:55:31 -0700 Subject: [PATCH] describe: warn user that describing multiple commits is experimental 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. --- CHANGELOG.md | 2 +- cli/src/description_util.rs | 9 +++++++-- cli/tests/test_describe_command.rs | 12 ++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 234d1f1e06..b8278b679d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,7 +103,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). * Added revset functions `author_date` and `committer_date`. -* `jj describe` can now update the description of multiple commits. +* `jj describe` can now update the description of multiple commits (experimental). ### Fixed bugs diff --git a/cli/src/description_util.rs b/cli/src/description_util.rs index b69694a8b6..cbc9ae370c 100644 --- a/cli/src/description_util.rs +++ b/cli/src/description_util.rs @@ -60,8 +60,13 @@ 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: Describing multiple commits at once is currently + JJ: **experimental**. + JJ: - The text you enter will be lost on a syntax error. + JJ: - The syntax 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 a61fdf5d05..6944f52193 100644 --- a/cli/tests/test_describe_command.rs +++ b/cli/tests/test_describe_command.rs @@ -225,6 +225,11 @@ fn test_describe_multiple_commits() { 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: Describing multiple commits at once is currently + JJ: **experimental**. + JJ: - The text you enter will be lost on a syntax error. + JJ: - The syntax may change in the future. + JJ: describe 8d650510daad ------- JJ: describe 41659b846096 ------- @@ -238,6 +243,13 @@ fn test_describe_multiple_commits() { &edit_script, indoc! {" write + JJ: Enter or edit commit descriptions after the `JJ: describe` lines. + + JJ: Warning: Describing multiple commits at once is currently + JJ: **experimental**. + JJ: - The text you enter will be lost on a syntax error. + JJ: - The syntax may change in the future. + JJ: describe 8d650510daad ------- description from editor of @-