Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

describe: warn user of limitations of describing multiple commits interface #4211

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cli/src/description_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::io::Write as _;

use bstr::ByteVec as _;
use indexmap::IndexMap;
use indoc::indoc;
use itertools::Itertools;
use jj_lib::backend::CommitId;
use jj_lib::commit::Commit;
Expand Down Expand Up @@ -58,6 +59,13 @@ pub fn edit_multiple_descriptions(
let mut commits_map = IndexMap::new();
let mut bulk_message = String::new();

bulk_message.push_str(indoc! {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.

"#});
for (commit_id, temp_commit) in commits.iter() {
let commit_hash = short_commit_hash(commit_id);
bulk_message.push_str("JJ: describe ");
Expand Down
9 changes: 9 additions & 0 deletions cli/tests/test_describe_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ 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 -------

JJ: describe 41659b846096 -------
Expand All @@ -236,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 @-

Expand Down
Loading