5 ms·
I don't know if it's the only or original reason, but one nice consequence of the reverse hex choice is that it means change IDs and commit IDs have completely
by aseipp 2y ago
I don't know if it's the only or original reason, but one nice consequence of the reverse hex choice is that it means change IDs and commit IDs have completely different alphabets ('0-9a-f' versus 'z-k'), so you can never have an ambiguous overlap between the two.
Jujutsu mostly doesn't care about the real "format" of a ChangeId, though. It's "really" just any arbitrary Vec<u8> and the backend itself has to define in some way and describe a little bit; the example backend has a 64-byte change ID, for example.[1] To the extent the reverse hex format matters it's mostly used in the template language for rendering things to the user. But you could also extend that with other render methods too.
[1] https://github.com/jj-vcs/jj/blob/5dc9da3c2b8f502b4f93ab336b3cd16288e3c9e0/lib/src/simple_backend.rs#L154 https://github.com/jj-vcs/jj/blob/5dc9da3c2b8f502b4f93ab336b...
- martinvonz 2y agoYes, it was to avoid ambiguity between the two kinds of IDs. See https://github.com/jj-vcs/jj/pull/1238 https://github.com/jj-vcs/jj/pull/1238 (see the individual commits).
- aseipp 2y agoInteresting, that was just a few short months before I showed up. :)