mirror of
https://github.com/jj-vcs/jj.git
synced 2026-07-10 11:34:22 +08:00
This addresses part of #4414 and implements something akin to what's described in @arxanas's [suggestion], with the exception that the editor contents don’t need to be completely cleared, since whether cleared or not it is not obvious whether the user intended to add an empty description or abort entirely. [suggestion]: https://github.com/jj-vcs/jj/issues/4414#issuecomment-2359123535 The hint is not shown if an empty description is provided via `--message ""`, since the user is explicitly bypassing the editor and wants to commit the change directly. Otherwise, if a user exits the editor with an empty description (notwithstanding any `JJ:` lines), it could be one of the following cases: 1. The user wants to commit the changes but no longer wants to add a description. The hint can simply be ignored. 2. The user wants to commit the changes and add a description but accidentally exits the editor. The second hint shows how to add a description to the parent commit. 3. The user no longer wants to commit the changes. However, a new commit is still created to maintain consistent behaviour as when an empty description is provided via the CLI. The first hint shows how to undo the commit.
19 KiB
19 KiB