mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-25 05:29:39 +00:00
cli: add jj describe --no-edit
to not open editor
This commit is contained in:
parent
3bacc367cd
commit
fc84c02c8e
3 changed files with 10 additions and 2 deletions
|
@ -56,7 +56,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
been moved from `jj debug` to `jj support`.
|
been moved from `jj debug` to `jj support`.
|
||||||
|
|
||||||
* `jj describe` now supports `--reset-author` for resetting a commit's author
|
* `jj describe` now supports `--reset-author` for resetting a commit's author
|
||||||
to the configured user.
|
to the configured user. `jj describe` also gained a `--no-edit` option to
|
||||||
|
avoid opening the editor.
|
||||||
|
|
||||||
### Fixed bugs
|
### Fixed bugs
|
||||||
|
|
||||||
|
|
|
@ -413,6 +413,11 @@ struct DescribeArgs {
|
||||||
/// Read the change description from stdin
|
/// Read the change description from stdin
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
stdin: bool,
|
stdin: bool,
|
||||||
|
/// Don't open an editor
|
||||||
|
///
|
||||||
|
/// This is mainly useful in combination with e.g. `--reset-author`.
|
||||||
|
#[arg(long)]
|
||||||
|
no_edit: bool,
|
||||||
/// Reset the author to the configured user
|
/// Reset the author to the configured user
|
||||||
///
|
///
|
||||||
/// This resets the author name, email, and timestamp.
|
/// This resets the author name, email, and timestamp.
|
||||||
|
@ -1807,6 +1812,8 @@ fn cmd_describe(
|
||||||
buffer
|
buffer
|
||||||
} else if let Some(message) = &args.message {
|
} else if let Some(message) = &args.message {
|
||||||
message.into()
|
message.into()
|
||||||
|
} else if args.no_edit {
|
||||||
|
commit.description().to_owned()
|
||||||
} else {
|
} else {
|
||||||
let template = description_template_for_commit(&workspace_command, &commit)?;
|
let template = description_template_for_commit(&workspace_command, &commit)?;
|
||||||
edit_description(workspace_command.repo(), &template, command.settings())?
|
edit_description(workspace_command.repo(), &template, command.settings())?
|
||||||
|
|
|
@ -177,7 +177,7 @@ fn test_describe_author() {
|
||||||
"--config-toml",
|
"--config-toml",
|
||||||
r#"user.name = "Ove Ridder"
|
r#"user.name = "Ove Ridder"
|
||||||
user.email = "ove.ridder@example.com""#,
|
user.email = "ove.ridder@example.com""#,
|
||||||
"-m=description",
|
"--no-edit",
|
||||||
"--reset-author",
|
"--reset-author",
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue