Skip to content
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

Error using a repository with a unicode primary bookmark name #5359

Open
Nemo157 opened this issue Jan 14, 2025 · 1 comment
Open

Error using a repository with a unicode primary bookmark name #5359

Nemo157 opened this issue Jan 14, 2025 · 1 comment
Labels
🐛bug Something isn't working good first issue Good for newcomers

Comments

@Nemo157
Copy link

Nemo157 commented Jan 14, 2025

Description

Attempting to use a repository that uses a unicode primary bookmark name fails. Commenting out the trunk() alias in the local config avoids the issue, and afaict all commands work correctly with the bookmark name (except where they need to know the head is immutable or primary).

Steps to Reproduce the Problem

> jj git clone https://github.com/Nemo157/ennead
Fetching into new repo in "/tmp/scratch.2025-01-14T14-08.do3GxX/ennead"
bookmark: κεφάλαιος@origin [new] untracked
Setting the revset alias "trunk()" to "κεφάλαιος@origin"
Working copy now at: rowmrups e527c90d (empty) (no description set)
Parent commit      : zsqrywow cf4d6273 κεφάλαιος | fix dithering functions for non-target size images
Added 23 files, modified 0 files, removed 0 files
> cd ennead
> jj log
Config error: Invalid `revset-aliases.immutable_heads()`
Caused by:
1:  --> 1:1
  |
1 | builtin_immutable_heads()
  | ^-----------------------^
  |
  = In alias "builtin_immutable_heads()"
2:  --> 1:9
  |
1 | present(trunk()) | tags() | untracked_remote_bookmarks()
  |         ^-----^
  |
  = In alias "trunk()"
3:  --> 1:1
  |
1 | κεφάλαιος@origin
  | ^---
  |
  = expected <identifier> or <expression>
For help, see https://martinvonz.github.io/jj/latest/config/.
> cat .jj/repo/config.toml
[revset-aliases]
"trunk()" = "κεφάλαιος@origin"

Specifications

@Nemo157
Copy link
Author

Nemo157 commented Jan 14, 2025

Figured out the actual solution, the config should be:

[revset-aliases]
"trunk()" = "'κεφάλαιος'@origin"

So the error is more that when cloning the repo it doesn't correctly serialize the bookmark name into revset syntax taking into account which bookmark names need escaping.

@PhilipMetzger PhilipMetzger added the 🐛bug Something isn't working label Jan 14, 2025
@martinvonz martinvonz added the good first issue Good for newcomers label Jan 14, 2025
yuja added a commit to yuja/jj that referenced this issue Jan 15, 2025
Tag and bookmark names are usually ASCII, but they occasionally include Latin
or Han characters.

This doesn't fix the serialization problem, but should mitigate jj-vcs#5359.
github-merge-queue bot pushed a commit that referenced this issue Jan 15, 2025
Tag and bookmark names are usually ASCII, but they occasionally include Latin
or Han characters.

This doesn't fix the serialization problem, but should mitigate #5359.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants