Skip to content

Commit

Permalink
cli: make jj desc and jj st aliases hidden
Browse files Browse the repository at this point in the history
Visible aliases interfere with shell completion, at least in Fish. For
example, `jj des<tab>` stops as `jj desc` without adding a space
afterwards, which make me stop for a second and wonder if I need to
add more letters. They also show up in the auto-complete menu.

I added "[aliases: <name>]" as part of the first line of the help text
so the `jj help` output still looks the same.
  • Loading branch information
martinvonz committed Nov 8, 2024
1 parent cd88baf commit fd271d3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
* Templates now support the `==` logical operator 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.

### Fixed bugs

## [0.23.0] - 2024-11-06
Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ use crate::description_util::ParsedBulkEditMessage;
use crate::text_util::parse_author;
use crate::ui::Ui;

/// Update the change description or other metadata
/// Update the change description or other metadata [aliases: desc]
///
/// 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(visible_aliases = &["desc"])]
#[command(alias = "desc")]
pub(crate) struct DescribeArgs {
/// The revision(s) whose description to edit
#[arg(default_value = "@")]
Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ use crate::diff_util::get_copy_records;
use crate::diff_util::DiffFormat;
use crate::ui::Ui;

/// Show high-level repo status
/// Show high-level repo status [aliases: st]
///
/// This includes:
///
/// * The working copy commit and its (first) parent, and a summary of the
/// changes between them
/// * Conflicted bookmarks (see https://martinvonz.github.io/jj/latest/bookmarks/)
#[derive(clap::Args, Clone, Debug)]
#[command(visible_alias = "st")]
#[command(alias = "st")]
pub(crate) struct StatusArgs {
/// Restrict the status display to these paths
#[arg(value_hint = clap::ValueHint::AnyPath)]
Expand Down
9 changes: 4 additions & 5 deletions cli/tests/[email protected]
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: cli/tests/test_generate_md_cli_help.rs
description: "AUTO-GENERATED FILE, DO NOT EDIT. This cli reference is generated by a test as an `insta` snapshot. MkDocs includes this snapshot from docs/cli-reference.md."
snapshot_kind: text
---
<!-- BEGIN MARKDOWN-->

Expand Down Expand Up @@ -124,7 +123,7 @@ To get started, see the tutorial at https://martinvonz.github.io/jj/latest/tutor
* `bookmark`Manage bookmarks
* `commit`Update the description and create a new change on top
* `config`Manage config options
* `describe`Update the change description or other metadata
* `describe`Update the change description or other metadata [aliases: desc]
* `diff`Compare file contents between two revisions
* `diffedit`Touch up the content changes in a revision with a diff editor
* `duplicate`Create a new change with the same content as an existing one
Expand All @@ -151,7 +150,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
* `status`Show high-level repo status [aliases: st]
* `tag`Manage tags
* `util`Infrequently used commands such as for generating shell completions
* `undo`Undo an operation (shortcut for `jj op undo`)
Expand Down Expand Up @@ -605,7 +604,7 @@ Update config file to unset the given option
## `jj describe`
Update the change description or other metadata
Update the change description or other metadata [aliases: desc]
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).
Expand Down Expand Up @@ -2054,7 +2053,7 @@ If a working-copy commit gets abandoned, it will be given a new, empty commit. T
## `jj status`
Show high-level repo status
Show high-level repo status [aliases: st]
This includes:
Expand Down

0 comments on commit fd271d3

Please sign in to comment.