From 3ab9ceb919768c4cf4d2fb15e5cb12bea40b7028 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Tue, 3 Dec 2024 21:02:01 +0900 Subject: [PATCH] cli: make `jj desc` and `jj st` aliases visible again This backs out commit fd271d39ad54 "cli: make `jj desc` and `jj st` aliases hidden." As we discussed in https://github.com/martinvonz/jj/pull/4811, completion of flags doesn't work for hidden aliases. --- CHANGELOG.md | 3 --- cli/src/commands/describe.rs | 4 ++-- cli/src/commands/status.rs | 4 ++-- cli/tests/cli-reference@.md.snap | 8 ++++---- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8de853563e..36967fd893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,9 +27,6 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). * Templates now support the `==` and `!=` logical operators for `Boolean`, `Integer`, and `String` types. -* The `jj desc` and `jj st` aliases are now hidden to not interfere with shell - completion. They remain available. - * New command `jj absorb` that moves changes to stack of mutable revisions. * New command `jj util exec` that can be used for arbitrary aliases. diff --git a/cli/src/commands/describe.rs b/cli/src/commands/describe.rs index 94da607179..cd2c0ce4a7 100644 --- a/cli/src/commands/describe.rs +++ b/cli/src/commands/describe.rs @@ -36,12 +36,12 @@ use crate::description_util::ParsedBulkEditMessage; use crate::text_util::parse_author; use crate::ui::Ui; -/// Update the change description or other metadata [aliases: desc] +/// Update the change description or other metadata /// /// Starts an editor to let you edit the description of changes. The editor /// will be $EDITOR, or `pico` if that's not defined (`Notepad` on Windows). #[derive(clap::Args, Clone, Debug)] -#[command(alias = "desc")] +#[command(visible_aliases = &["desc"])] pub(crate) struct DescribeArgs { /// The revision(s) whose description to edit #[arg(default_value = "@", add = ArgValueCandidates::new(complete::mutable_revisions))] diff --git a/cli/src/commands/status.rs b/cli/src/commands/status.rs index e9f52d525a..8c1d9d9137 100644 --- a/cli/src/commands/status.rs +++ b/cli/src/commands/status.rs @@ -26,7 +26,7 @@ use crate::diff_util::get_copy_records; use crate::diff_util::DiffFormat; use crate::ui::Ui; -/// Show high-level repo status [aliases: st] +/// Show high-level repo status /// /// This includes: /// @@ -34,7 +34,7 @@ use crate::ui::Ui; /// changes between them /// * Conflicted bookmarks (see https://martinvonz.github.io/jj/latest/bookmarks/) #[derive(clap::Args, Clone, Debug)] -#[command(alias = "st")] +#[command(visible_alias = "st")] pub(crate) struct StatusArgs { /// Restrict the status display to these paths #[arg(value_hint = clap::ValueHint::AnyPath)] diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index 1cbd3cea98..7c2d078112 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -127,7 +127,7 @@ To get started, see the tutorial at https://martinvonz.github.io/jj/latest/tutor * `bookmark` — Manage bookmarks [default alias: b] * `commit` — Update the description and create a new change on top * `config` — Manage config options -* `describe` — Update the change description or other metadata [aliases: desc] +* `describe` — Update the change description or other metadata * `diff` — Compare file contents between two revisions * `diffedit` — Touch up the content changes in a revision with a diff editor * `duplicate` — Create new changes with the same content as existing ones @@ -154,7 +154,7 @@ To get started, see the tutorial at https://martinvonz.github.io/jj/latest/tutor * `sparse` — Manage which paths from the working-copy commit are present in the working copy * `split` — Split a revision in two * `squash` — Move changes from a revision into another revision -* `status` — Show high-level repo status [aliases: st] +* `status` — Show high-level repo status * `tag` — Manage tags * `util` — Infrequently used commands such as for generating shell completions * `undo` — Undo an operation (shortcut for `jj op undo`) @@ -635,7 +635,7 @@ Update config file to unset the given option ## `jj describe` -Update the change description or other metadata [aliases: desc] +Update the change description or other metadata Starts an editor to let you edit the description of changes. The editor will be $EDITOR, or `pico` if that's not defined (`Notepad` on Windows). @@ -2107,7 +2107,7 @@ If a working-copy commit gets abandoned, it will be given a new, empty commit. T ## `jj status` -Show high-level repo status [aliases: st] +Show high-level repo status This includes: