mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-30 11:31:13 +00:00
commands: Make all description_template call sites look the same
Just to make similar code look similar for easier grepping/understanding.
This commit is contained in:
parent
67128dd0ed
commit
32e841c444
@ -147,7 +147,8 @@ new working-copy commit.
|
||||
let description = add_trailers(ui, &tx, &commit_builder)?;
|
||||
commit_builder.set_description(description);
|
||||
let temp_commit = commit_builder.write_hidden()?;
|
||||
let description = description_template(ui, &tx, "", &temp_commit)?;
|
||||
let intro = "";
|
||||
let description = description_template(ui, &tx, intro, &temp_commit)?;
|
||||
let description = edit_description(&text_editor, &description)?;
|
||||
if description.is_empty() {
|
||||
writedoc!(
|
||||
|
@ -205,7 +205,8 @@ pub(crate) fn cmd_describe(
|
||||
.try_collect()?;
|
||||
|
||||
if let [(_, temp_commit)] = &*temp_commits {
|
||||
let template = description_template(ui, &tx, "", temp_commit)?;
|
||||
let intro = "";
|
||||
let template = description_template(ui, &tx, intro, temp_commit)?;
|
||||
let description = edit_description(&text_editor, &template)?;
|
||||
commit_builders[0].set_description(description);
|
||||
} else {
|
||||
|
@ -241,12 +241,8 @@ pub(crate) fn cmd_split(
|
||||
let new_description = add_trailers(ui, &tx, &commit_builder)?;
|
||||
commit_builder.set_description(new_description);
|
||||
let temp_commit = commit_builder.write_hidden()?;
|
||||
let template = description_template(
|
||||
ui,
|
||||
&tx,
|
||||
"Enter a description for the selected changes.",
|
||||
&temp_commit,
|
||||
)?;
|
||||
let intro = "Enter a description for the selected changes.";
|
||||
let template = description_template(ui, &tx, intro, &temp_commit)?;
|
||||
edit_description(&text_editor, &template)?
|
||||
};
|
||||
commit_builder.set_description(description);
|
||||
@ -291,12 +287,8 @@ pub(crate) fn cmd_split(
|
||||
let new_description = add_trailers(ui, &tx, &commit_builder)?;
|
||||
commit_builder.set_description(new_description);
|
||||
let temp_commit = commit_builder.write_hidden()?;
|
||||
let template = description_template(
|
||||
ui,
|
||||
&tx,
|
||||
"Enter a description for the remaining changes.",
|
||||
&temp_commit,
|
||||
)?;
|
||||
let intro = "Enter a description for the remaining changes.";
|
||||
let template = description_template(ui, &tx, intro, &temp_commit)?;
|
||||
edit_description(&text_editor, &template)?
|
||||
};
|
||||
commit_builder.set_description(description);
|
||||
|
@ -202,7 +202,6 @@ pub(crate) fn cmd_squash(
|
||||
add_trailers(ui, &tx, &commit_builder)?
|
||||
}
|
||||
} else {
|
||||
let intro = "Enter a description for the combined commit.";
|
||||
let combined = combine_messages_for_editing(
|
||||
ui,
|
||||
&tx,
|
||||
@ -213,6 +212,7 @@ pub(crate) fn cmd_squash(
|
||||
// It's weird that commit.description() contains "JJ: " lines, but works.
|
||||
commit_builder.set_description(combined);
|
||||
let temp_commit = commit_builder.write_hidden()?;
|
||||
let intro = "Enter a description for the combined commit.";
|
||||
let template = description_template(ui, &tx, intro, &temp_commit)?;
|
||||
edit_description(&text_editor, &template)?
|
||||
}
|
||||
|
@ -206,7 +206,8 @@ pub fn edit_multiple_descriptions(
|
||||
bulk_message.push_str(&commit_hash);
|
||||
bulk_message.push_str(" -------\n");
|
||||
commits_map.insert(commit_hash, *commit_id);
|
||||
let template = description_template(ui, tx, "", temp_commit)?;
|
||||
let intro = "";
|
||||
let template = description_template(ui, tx, intro, temp_commit)?;
|
||||
bulk_message.push_str(&template);
|
||||
append_blank_line(&mut bulk_message);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user