forked from mirrors/jj
describe multiple commits: instruct user where to put commit descriptions
This seems especially helpful if the descriptions start out empty.
This commit is contained in:
parent
07e9339c6a
commit
6d1cc7f803
2 changed files with 7 additions and 0 deletions
|
@ -3,6 +3,7 @@ use std::io::Write as _;
|
||||||
|
|
||||||
use bstr::ByteVec as _;
|
use bstr::ByteVec as _;
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
use indoc::indoc;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use jj_lib::backend::CommitId;
|
use jj_lib::backend::CommitId;
|
||||||
use jj_lib::commit::Commit;
|
use jj_lib::commit::Commit;
|
||||||
|
@ -62,6 +63,10 @@ pub fn edit_multiple_descriptions(
|
||||||
let mut commits_map = IndexMap::new();
|
let mut commits_map = IndexMap::new();
|
||||||
let mut bulk_message = String::new();
|
let mut bulk_message = String::new();
|
||||||
|
|
||||||
|
bulk_message.push_str(indoc! {r#"
|
||||||
|
JJ: Enter or edit commit descriptions after the `JJ: describe` lines.
|
||||||
|
|
||||||
|
"#});
|
||||||
for (commit_id, temp_commit) in commits.iter() {
|
for (commit_id, temp_commit) in commits.iter() {
|
||||||
let commit_hash = short_commit_hash(commit_id);
|
let commit_hash = short_commit_hash(commit_id);
|
||||||
bulk_message.push_str("JJ: describe ");
|
bulk_message.push_str("JJ: describe ");
|
||||||
|
|
|
@ -223,6 +223,8 @@ fn test_describe_multiple_commits() {
|
||||||
"###);
|
"###);
|
||||||
insta::assert_snapshot!(
|
insta::assert_snapshot!(
|
||||||
std::fs::read_to_string(test_env.env_root().join("editor0")).unwrap(), @r###"
|
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: describe 8d650510daad -------
|
JJ: describe 8d650510daad -------
|
||||||
|
|
||||||
JJ: describe 41659b846096 -------
|
JJ: describe 41659b846096 -------
|
||||||
|
|
Loading…
Reference in a new issue