Skip to content

jj git push --named fails to handle -- in bookmark names #8673

@indygreg

Description

@indygreg

This is very similar to #7593 but I'm filing against jj git push --named.

My work has an almost universal practice to use -- in names as a delimiter. This is causing a bit of confusion with jj adopters since the current error message when double dash is encountered isn't very actionable. This is especially true in the jj git push --named ... case. e.g.:

$ jj git push --named 'foo--x=@'
Error: Could not parse 'foo--x' as a bookmark name
Caused by:
1: Failed to parse bookmark name: Syntax error
2:  --> 1:4
  |
1 | foo--x
  |    ^---
  |
  = expected <EOI>
Hint: For example, `--named myfeature=@` is valid syntax

This error seems very odd to me because I would expect the --named parser to split on = and treat the left side as an identifier. But I think it is somehow treating the LHS as a revset, yielding the syntax error?

In all cases (including #7593), I find the error message in these cases a bit confusing. It says Syntax error but isn't saying which syntax. (I can infer it is a revset but this may not be obvious to novice jj users.) Perhaps the hint could be improved to mention revset or suggest quoting techniques if the expression is likely not a revset (lacks parentheses, spaces, etc)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions