Replies: 2 comments 1 reply
-
I had a similar question and just found https://github.com/hymkor/jjtagdesc. It doesn't look like it works anymore probably due to output changes in |
Beta Was this translation helpful? Give feedback.
1 reply
-
This is awesome. Thanks for sharing. I converted to a Fish shell function which is working well: # https://github.com/jj-vcs/jj/discussions/2563
function jj_describe --description 'replicate git describe --tags for jj'
set count 0
set tag ""
set latest_commit ""
set jj_output (jj log -r 'latest(tags())::@- ~ empty()' --no-graph --reversed -T 'commit_id.short(10) ++ " " ++ tags ++ "\n"')
for line in $jj_output
set count (math $count + 1)
set -l parts (string split " " $line)
set latest_commit $parts[1]
if test (count $parts) -gt 1; and test -z "$tag"
set tag (string sub --start 2 $parts[2])
end
end
printf "%s-%d-%s\n" $tag $count $latest_commit
end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I really like using
git describe --tags
as an easy way to generate a version string. It has the following advantages:HEAD
is on a commit corresponding to a release tag, you get that release versionIs there anything like this in
jj
? For collocated reposgit describe --tags
works, but I think it would be good to have a native command that behaves similarly.Beta Was this translation helpful? Give feedback.
All reactions