Description
Summary
I'd like to request the ability to add descriptions to custom aliases in the config file, and have these descriptions appear in jj --help
and jj help
output.
Current Behavior
Currently, my aliases look like this in my config:
[aliases]
# short alias for squash
sq = ["squash"]
# find the nearest bookmark and move it forward to the nearest pushable revision
tug = ["bookmark", "move", "--from", "closest_bookmark(@)", "--to", "closest_pushable(@)"]
When running jj --help
, I notice:
- Simple aliases to built-in commands like
b
forbookmark
show up asbookmark Manage bookmarks [default alias: b]
- My simple alias
sq
doesn't show up similarly next to thesquash
command - Custom complex aliases like
tug
don't show up at all
This creates a real usability issue - for aliases that I use only occasionally (like tug
), I often forget their exact semantics so I have to go back and manually review my config.toml
file to remind myself what it does. This adds friction to my workflow and makes my custom aliases less useful than they could be.
Proposed Solution
I propose extending the alias configuration format to support descriptions, perhaps like:
[aliases]
sq = { command = ["squash"], description = "Short alias for squash command" }
tug = {
command = ["bookmark", "move", "--from", "closest_bookmark(@)", "--to", "closest_pushable(@)"],
description = "Move nearest bookmark to nearest pushable revision"
}
With this change, the jj --help
output could look something like:
Jujutsu (An experimental VCS)
Usage: jj [OPTIONS] <COMMAND>
Commands:
abandon Abandon a revision
bookmark Manage bookmarks [default alias: b]
commit Update the description and create a new change on top
diff Compare file contents between two revisions
squash Move changes from a revision into another revision [aliases: sq]
status Show high-level repo status [aliases: st]
...
Custom Aliases:
tug Move nearest bookmark to nearest pushable revision
Options:
-h, --help Print help (see a summary with '-h')
...
Benefits
- Simple aliases like
sq
would be shown next to their commands, similar to how built-in aliases are shown - Complex aliases like
tug
would get their own section with descriptions - Most importantly, I wouldn't need to go back to my config file every time I forget what an occasionally-used alias does - I could just check the help output
Would this feature be useful to add to jj? I think it would make custom aliases much more integrated into the tool's workflow and reduce the cognitive load of remembering what each alias does.