Replies: 3 comments
-
|
Related: #5837 |
Beta Was this translation helpful? Give feedback.
-
|
I also just got a changeset short ID of Footnotes
|
Beta Was this translation helpful? Give feedback.
-
|
I'm sorry, but I find this problem hilarious and want to keep it as an Easter egg. Anyway. The priority is well-defined: Matching tag and bookmark names will be chosen over change IDs (and commit IDs). With that in mind, maybe the logic that determines short change IDs (and thus what is shown in purple) should be aware of bookmarks and tags that might conflict and consider those names like "xml" already used. UPDATE: Oh, I just scrolled right past the link to
They are just opaque byte sequences displayed in hexadecimal. But, instead of using the alphabet There are times where jj uses a hash function to generate the byte sequence: When you import a commit from Git, the commit ID is deterministically used to create the change ID. This means if you clone a repo twice, you get the same change IDs. But those change IDs are just stored as opaque values and not used to verify anything. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying
jj, and trying out this shell prompt withjjstatus info. I was very confused to see the following:This looks like it's telling me that I'm on (or close) to a bookmark named
xml. I was confused because there is no use of XML in the project, but there are a lot of old branches and perhaps I typed something wrong. Or maybe I wasn't aware of some unexpected interaction between tools and anxmlbookmark/branch was introduced to the project.(Note that
18in the screenshot is actually a short ID for a commit, not a number representative of anything. That also has some potential for confusion, but I'm a little less worried about it in this case.)Turns out that, nope,
xmlwas just the prefix for a changeset ID:It seems that
punis also a short ID in that screenshot (a with a longer prefix ofpunk!), as well asmyandyo. Those are less plausible names for me, but it does highlight that the arbitrary nonsense of short IDs can form too much sense by accident.If I run
jj bookmark set xml, then the twoxmls will both show as purple, which further conflates them:I now have no idea which one would be chosen by a command like
jj new xml. At the very least, it would be useful for short IDs to avoid collisions with current bookmarks when computing the prefix length.This isn't an issue in
gitbecause:This isn't
jj's fault per se, but even as someone who has extensive experience with version control I was thrown off by this. And I think even if I get a lot more experience withjj, I would still pause for at something like this in the future.I think it certainly has the potential to cause confusion for others as well. To me, it has the kind of "oh yeah, that's confusing the first time you run into it, but you get used to it" vibes that I think think people find unappealing about
gitcompared tojj.But it might be possible to do something about this. For example:
githas used this since 2017.Obviously, there is no objective list of words that can be used. 1 Common words vary by language and region, and change over time. Words . And even an acronym like
ymmvcould be considered to look like something intentional rather than random. However, the second approach above can adapt to a changing (or even locally customizable) set of words.EDIT: I wrote the above assuming changeset IDs are produced by a hash. But thinking more about how
jjworks, that might not be the case? In which case, rejection sampling for changeset IDs might actually be easier than I was thinking.Footnotes
If it was up to me, though, I'd start with an English dictionary + a scan of GitHub for common branch names and variable names in code. ↩
Beta Was this translation helpful? Give feedback.
All reactions