cli: add `--stdin` and `--edit` flags to `jj commit`
Add --stdin flag to read commit messages from stdin, matching the existing pattern in jj describe. This solves the problem of passing multi-line commit messages from scripts and the command line without shell escaping issues.
Add --edit flag to allow opening an editor after providing a message via --stdin or -m, enabling users to refine messages in two stages.
Implementation:
- Added proper conflicts:
--stdincannot be used with-m,--interactive, or--tool - Restructured description handling to check stdin first, then -m flags, then fall back to editor
- Introduced
use_editorvariable to control editor invocation - Trailers are properly handled in all code paths
This brings jj commit to feature parity with jj describe for message input methods.
Checklist
- Added CHANGELOG entry
- Added comprehensive tests for stdin functionality
- All existing tests pass
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Signed the CLA
Comments should be resolved!