Is your feature request related to a problem? Please describe.
I frequently forget the -r when running jj split. If I run jj split abc, because abc doesn't match any filenames, jj split decides that I want to split out an empty commit, and drops me straight into an editor to enter a commit message for the new empty commit. Depending on my editor, I may have no good way out of this other than to quit twice then jj undo.
jj split produces a warning, but I don't get to see it, because my editor has taken over the terminal. And if my editor doesn't use altscreen, then I don't even get to see it when I quit the editor!
Describe the solution you'd like
Really, anything better would be nice.
Describe alternatives you've considered
jj split abc, if abc matches no paths (or possibly if it matches no changes), could fail unless I specify --allow-empty or similar, at least in the case where abc is a valid change id. (See also #9245, which is a variant of this.)
Or jj could reject filesets that match no files in general. (I guess with a global flag to override.)
Or jj could detect when a filename input is a valid change id in general, and ask that you use a ./ prefix if that's what you really meant. (Probably not great for use from scripts.)
Or the editor that opens to enter the commit message could explain what happened, and maybe some special commit message such as "undo" or "abort" would bail out instead of creating the empty commit. I even think it'd be worth pre-filling the commit message with the special "abort" message so that quitting the editor without changing the message would abandon the split.
Is your feature request related to a problem? Please describe.
I frequently forget the
-rwhen runningjj split. If I runjj split abc, becauseabcdoesn't match any filenames,jj splitdecides that I want to split out an empty commit, and drops me straight into an editor to enter a commit message for the new empty commit. Depending on my editor, I may have no good way out of this other than to quit twice thenjj undo.jj splitproduces a warning, but I don't get to see it, because my editor has taken over the terminal. And if my editor doesn't use altscreen, then I don't even get to see it when I quit the editor!Describe the solution you'd like
Really, anything better would be nice.
Describe alternatives you've considered
jj split abc, ifabcmatches no paths (or possibly if it matches no changes), could fail unless I specify--allow-emptyor similar, at least in the case whereabcis a valid change id. (See also #9245, which is a variant of this.)Or
jjcould reject filesets that match no files in general. (I guess with a global flag to override.)Or
jjcould detect when a filename input is a valid change id in general, and ask that you use a./prefix if that's what you really meant. (Probably not great for use from scripts.)Or the editor that opens to enter the commit message could explain what happened, and maybe some special commit message such as "undo" or "abort" would bail out instead of creating the empty commit. I even think it'd be worth pre-filling the commit message with the special "abort" message so that quitting the editor without changing the message would abandon the split.