jj
jj copied to clipboard
FR: warn if the description is empty when this is likely unintended
Is your feature request related to a problem? Please describe. in git, if the description is empty, it will cancel the commit altogether. jj instead creates a commit with an empty description.
this is ok, but it's probably not the intended behavior, especially if this is overwriting a previously non-empty description, or if the diff is empty.
Describe the solution you'd like jj should prompt interactively if you're sure in the following cases:
jj describeoverwriting a non-empty description to emptyjj newcreating an empty description for an empty diff (in the parent, to be clear, of course the working copy will be empty at first)jj commitcreating an empty description, regardless of the diff contents; people have muscle memory from git that an empty description cancels the commit.
Describe alternatives you've considered
- only warn for a subset of these cases
- don't add any warnings. i would prefer not to do this, i think it's a footgun.
- add these warnings, but add a
-y/--yesflag to ignore the warnings, restoring the current behavior.
Additional context cc https://github.com/martinvonz/jj/pull/2976
I think a warning is good as the user can simply jj undo. Interactive prompt is sometimes annoying.
I think a warning is good as the user can simply jj undo. Interactive prompt is sometimes annoying.
git-branchless after hiding (abandoning) commits will print out a message like Hid X commits. If this was unintentional, run: git undo, and this is good because it doubles as an onboarding workflow, even if you never undo that operation in particular. We could conceivably add (more?) notes/warnings to run jj undo in various commands, including this one.
frankly i forgot that jj undo exists :laughing: a warning that suggests jj undo sounds perfect!