jj
jj copied to clipboard
cli: add global option to not commit transaction
Checklist
If applicable:
- [x] I have updated
CHANGELOG.md - [ ] I have updated the documentation (README.md, docs/, demos/)
- [ ] I have updated the config schema (cli/src/config-schema.json)
- [x] I have added tests to cover my changes
This pr doesn't seem to have a link to #2562 -- adding with this message
I have a couple questions, based on my interpretation of the intent of this PR:
Besides a global flag for most jj commands, could it be possible to make this behaviour controllable via an env var?
Because in most use cases (again, if I understand correctly the goal here), you are likely to want to bunch together quite a few jj operations in the same "transaction block". Exposing an env var to the whole block would make sure you don't forget to add --no-commit-transaction to one operation.
Is the goal to also add a new command like jj op commit-transaction to actually commit? Or should we just run the last operation without the --no-commit-transaction flag? The latter API seems less convenient to use in practice in scripts, as you'd need to special case the last operation just for the sake of compliance with this API.
Besides a global flag for most jj commands, could it be possible to make this behaviour controllable via an env var?
I don't think env var will help. You'll need to run jj with --at-op <prev-op-id> to chain unpublished commands anyway. I assume a convenient interface will be added by jj api or something.
Is the goal to also add a new command like
jj op commit-transactionto actually commit?
That could be.