From 289b9bc71f7e38b5fccb1c9b33c5b80a2f06e6a9 Mon Sep 17 00:00:00 2001 From: Khionu Sybiern Date: Thu, 7 Mar 2024 12:01:17 -0800 Subject: [PATCH] cli: update help message for `jj edit` 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. --- cli/src/commands/edit.rs | 6 +++--- cli/tests/cli-reference@.md.snap | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/src/commands/edit.rs b/cli/src/commands/edit.rs index 9a4aac7c6..65bd2d6bc 100644 --- a/cli/src/commands/edit.rs +++ b/cli/src/commands/edit.rs @@ -21,10 +21,10 @@ 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 use `jj new` and `jj +/// squash`. #[derive(clap::Args, Clone, Debug)] pub(crate) struct EditArgs { /// The commit to edit diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index 18e86e888..8fbdcecfb 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -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 @@ -706,9 +706,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 use `jj new` and `jj squash`. **Usage:** `jj edit `