Skip to content

Commit

Permalink
cli branch create/set: add --at/--to aliases to -r
Browse files Browse the repository at this point in the history
Now that `jj move` does not accept `-r`, `jj set --to` seems more useful
than `jj set -r`.

I am not sure whether `-r` should be kept or removed.

I was also considering adding `create --to` as alias for `create -r`,
but I am hoping `--at` will be easy enough to remember since it's the
preposition one would think of.
  • Loading branch information
ilyagr committed Jul 16, 2024
1 parent 58a772d commit 2fd42af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cli/src/commands/branch/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::ui::Ui;
#[derive(clap::Args, Clone, Debug)]
pub struct BranchCreateArgs {
/// The branch's target revision
#[arg(long, short)]
#[arg(long, short, visible_alias = "at")]
revision: Option<RevisionArg>,

/// The branches to create
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/branch/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::ui::Ui;
#[derive(clap::Args, Clone, Debug)]
pub struct BranchSetArgs {
/// The branch's target revision
#[arg(long, short)]
#[arg(long, short, visible_alias = "to")]
revision: Option<RevisionArg>,

/// Allow moving the branch backwards or sideways
Expand Down
6 changes: 2 additions & 4 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ Use `jj obslog -p` to see how your working-copy commit has evolved. Find the
commit you want to restore the contents to. Let's say the current commit (with
the changes intended for a new commit) are in commit X and the state you wanted
is in commit Y. Note the commit id (normally in blue at the end of the line in
the log output) of each of them. Now use `jj new` to create a new working-copy
commit, then run `jj restore --from Y --to @-` to restore the parent commit
to the old state, and `jj restore --from X` to restore the new working-copy
commit to the new state.
the log output) of each of them. Now use `jj split --restore-from Y` to split
the current commit into its old version and the changes since then.

### How do I resume working on an existing change?

Expand Down

0 comments on commit 2fd42af

Please sign in to comment.