Skip to content

Commit

Permalink
cli: update help message for jj edit
Browse files Browse the repository at this point in the history
This change updates the language of `jj edit`'s help message to be
more clear as to the nature of the command. It also adds a 
recommendation for a more idiomatic/safer workflow.
  • Loading branch information
khionu committed Mar 8, 2024
1 parent 663e352 commit 8cada3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions cli/src/commands/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ use crate::cli_util::{CommandHelper, RevisionArg};
use crate::command_error::CommandError;
use crate::ui::Ui;

/// Edit a commit in the working copy
/// Sets the specified revision as the working-copy revision
///
/// Puts the contents of a commit in the working copy for editing. Any changes
/// you make in the working copy will update (amend) the commit.
/// Note: it is generally recommended to instead to use `jj new` and `jj
/// squash`. Creating a new revision enables being more intentional with respect
/// to the existing revision.
#[derive(clap::Args, Clone, Debug)]
pub(crate) struct EditArgs {
/// The commit to edit
Expand Down
6 changes: 3 additions & 3 deletions cli/tests/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ To get started, see the tutorial at https://github.com/martinvonz/jj/blob/main/d
* `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
* `edit`Edit a commit in the working copy
* `edit`Sets the specified revision as the working-copy revision
* `files`List files in a revision
* `git`Commands for working with the underlying Git repo
* `init`Create a new repo in the given directory
Expand Down Expand Up @@ -707,9 +707,9 @@ Create a new change with the same content as an existing one
## `jj edit`
Edit a commit in the working copy
Sets the specified revision as the working-copy revision
Puts the contents of a commit in the working copy for editing. Any changes you make in the working copy will update (amend) the commit.
Note: it is generally recommended to instead to use `jj new` and `jj squash`. Creating a new revision enables being more intentional with respect to the existing revision.
**Usage:** `jj edit <REVISION>`
Expand Down

0 comments on commit 8cada3f

Please sign in to comment.