Skip to content

Commit

Permalink
Add short a -e alias for --edit to prev and next
Browse files Browse the repository at this point in the history
I'm not sure if this was an intentional omission, but I think it would be
useful to have `-e` as a short flag for `--edit`. I don't usually edit commits,
but I do use `prev` and `next` with edit to navigate to a commit that I want to
squash. Often this is easier than typing `--from` and `--into` plus the change
IDs.

If people want to edit commits we shouldn't stand in their way.
  • Loading branch information
emesterhazy committed Apr 21, 2024
1 parent e0c53bc commit a2c49ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/src/commands/next.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub(crate) struct NextArgs {
/// Instead of creating a new working-copy commit on top of the target
/// commit (like `jj new`), edit the target commit directly (like `jj
/// edit`).
#[arg(long)]
#[arg(long, short)]
edit: bool,
}

Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/prev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub(crate) struct PrevArgs {
#[arg(default_value = "1")]
offset: u64,
/// Edit the parent directly, instead of moving the working-copy commit.
#[arg(long)]
#[arg(long, short)]
edit: bool,
}

Expand Down
4 changes: 2 additions & 2 deletions cli/tests/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ implied.
###### **Options:**
* `--edit` — Instead of creating a new working-copy commit on top of the target commit (like `jj new`), edit the target commit directly (like `jj edit`)
* `-e`, `--edit` — Instead of creating a new working-copy commit on top of the target commit (like `jj new`), edit the target commit directly (like `jj edit`)
Possible values: `true`, `false`
Expand Down Expand Up @@ -1433,7 +1433,7 @@ implied.
###### **Options:**
* `--edit` — Edit the parent directly, instead of moving the working-copy commit
* `-e`, `--edit` — Edit the parent directly, instead of moving the working-copy commit
Possible values: `true`, `false`
Expand Down

0 comments on commit a2c49ab

Please sign in to comment.