Change-namespaced short commit IDs #4312
mlcui-corp
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At the moment, commit IDs (cf. change IDs) are typically used for:
jj obslog
,jj --at-op
, or an old invocation ofjj log
.git push origin COMMIT_ID:refs/for/main
. These cannot use short IDs.The current status quo of short commit IDs - unique prefixes for all visible commits in
revsets.short-prefixes
, then globally-unique prefixes - is fine for the divergent change use case, but falls short for the "old versions of changes" use case:jj log
invocation (equivalently,jj log --at-op
) often don't work, as those commits became invisible. Restoring those require a longer prefix.jj obslog
- are very long, as they need to be globally unique prefixes.My proposal would be to allow specification of short commit IDs in the namespace of a given change. Using a (not final) syntax of
change??commit
,tnpw??a8
would refer to "the unique (visible) commit in the obslog of changetnpw
with prefixa8
".If such a thing existed:
jj log
could be shown aschange??short_visible_commit
instead of the currentchange??
. As there are commonly only two visible commits for a divergent change,short_visible_commit
will often only be a single character.change??short_commit
(not over visible commits), so short commit IDs from oldjj log
outputs should still work even if the commit was hidden (as long as there are no new commits with the same change and prefix).jj obslog
commit IDs would be much shorter.Beta Was this translation helpful? Give feedback.
All reactions