-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR: error out when creating branches with @ in the name #4358
Comments
There's some prior discussion in #3932, but I believe the consensus is that Even so, I believe there's an error in your initial issue: you can't "move" a remote branch locally. The only way to do that is to move the local tracking branch to the desired commit (via |
Do you want |
Short flags would be nice |
I still believe this should be an error by default (creating a branch with an
And it should probably be an error if I try to move a remote tracking branch c: |
I don't think it should be an error (because |
We already issue warnings for invalid branch names. Foo="$(ls)" # accidental contents
jj b c "$FOO" # works with warning
jj b d "$FOO" # will error, hint suggests to us exact: Problems occur if something like Related, bookmarks with invalid characters cannot be exported to git (which produces a warning), further info on valid git refs can be found here: https://git-scm.com/docs/git-check-ref-format |
Is your feature request related to a problem? Please describe.
I have accidentally created branches when I wanted to move a remote branch (e.g.
jj branch set branch@origin -r @-
). This usually happens when I want to set it to a specific change with the-r
option, asjj branch move
uses the--to
flag instead of the-r
flag.Describe the solution you'd like
Fail to create branches with
@
in the name by default (I assumegit
allows creating branches with@
s in the name so you want to still be able to use/create such branches, but not by default).Describe alternatives you've considered
-r/--revision
as an alias to--to
injj branch move
jj branch set --create-if-missing new-branch
)The text was updated successfully, but these errors were encountered: