mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-24 12:48:55 +00:00
cli: add command aliases such as "commit" for "close"
Although "commit" isn't technically correct for what `close` does, it's how new users think of it, so let's make it a bit easier for them.
This commit is contained in:
parent
ced252f766
commit
ae3ff4e1be
2 changed files with 11 additions and 6 deletions
|
@ -6,7 +6,8 @@ TODO: Describe the differences compared to Git here
|
|||
|
||||
Note that all `jj` commands can be run on any commit (not just the working copy
|
||||
commit), but that's left out of the table to keep it simple. For example,
|
||||
`jj squash -r <revision>` will move the diff from that revision into its parent.
|
||||
`jj squash/amend -r <revision>` will move the diff from that revision into its
|
||||
parent.
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
|
@ -80,7 +81,7 @@ commit), but that's left out of the table to keep it simple. For example,
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Finish work on the current change and start a new change</td>
|
||||
<td><code>jj close</code></td>
|
||||
<td><code>jj close/commit</code></td>
|
||||
<td><code>git commit -a</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -142,13 +143,13 @@ commit), but that's left out of the table to keep it simple. For example,
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Move the diff in the current change into the parent change</td>
|
||||
<td><code>jj squash</code></td>
|
||||
<td><code>jj squash/amend</code></td>
|
||||
<td><code>git commit --amend -a</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Interactively move part of the diff in the current change into the
|
||||
parent change</td>
|
||||
<td><code>jj squash -i</code></td>
|
||||
<td><code>jj squash/amend -i</code></td>
|
||||
<td><code>git add -p; git commit --amend</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -165,8 +166,8 @@ commit), but that's left out of the table to keep it simple. For example,
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Resolve conflicts and continue interrupted operation</td>
|
||||
<td><code>echo resolved > filename; jj squash</code> (operations don't
|
||||
get interrupted, so no need to continue)</td>
|
||||
<td><code>echo resolved > filename; jj squash/amend</code> (operations
|
||||
don't get interrupted, so no need to continue)</td>
|
||||
<td><code>echo resolved > filename; git add filename; git
|
||||
rebase/merge/cherry-pick --continue</code></td>
|
||||
</tr>
|
||||
|
|
|
@ -758,6 +758,7 @@ With the `--from` and/or `--to` options, shows the difference from/to the given
|
|||
.help("Read the change description from stdin"),
|
||||
);
|
||||
let close_command = SubCommand::with_name("close")
|
||||
.alias("commit")
|
||||
.about("Mark a revision closed")
|
||||
.long_about(
|
||||
"Mark a revision closed. See `jj concepts working-copy` for information about \
|
||||
|
@ -772,6 +773,7 @@ With the `--from` and/or `--to` options, shows the difference from/to the given
|
|||
.arg(message_arg().help("The change description to use (don't open editor)"));
|
||||
let open_command = SubCommand::with_name("open")
|
||||
.about("Mark a revision open")
|
||||
.alias("uncommit")
|
||||
.long_about(
|
||||
"Mark a revision open. See `jj concepts working-copy` for information about \
|
||||
open/closed revisions.",
|
||||
|
@ -822,6 +824,7 @@ With the `--from` and/or `--to` options, shows the difference from/to the given
|
|||
),
|
||||
);
|
||||
let squash_command = SubCommand::with_name("squash")
|
||||
.alias("amend")
|
||||
.about("Move changes from a revision into its parent")
|
||||
.long_about(
|
||||
"Move changes from a revision into its parent. After moving the changes into the \
|
||||
|
@ -839,6 +842,7 @@ With the `--from` and/or `--to` options, shows the difference from/to the given
|
|||
// TODO: It doesn't make much sense to run this without -i. We should make that
|
||||
// the default. We should also abandon the parent commit if that becomes empty.
|
||||
let unsquash_command = SubCommand::with_name("unsquash")
|
||||
.alias("unamend")
|
||||
.about("Move changes from a revision's parent into the revision")
|
||||
.arg(rev_arg())
|
||||
.arg(
|
||||
|
|
Loading…
Reference in a new issue