Skip to content

Instantly share code, notes, and snippets.

@hymkor
Last active February 4, 2026 09:39
Show Gist options
  • Select an option

  • Save hymkor/a80d59e7e99efa7a3b0cc10d929f51a7 to your computer and use it in GitHub Desktop.

Select an option

Save hymkor/a80d59e7e99efa7a3b0cc10d929f51a7 to your computer and use it in GitHub Desktop.
`git describe --tags` と同じようなことを jj でやる PowerShell Script
# PowerShell Script for jj which is equivalent to `git describe --tags`
function jj-describe(){
$tag=jj log -r "latest(::@ & tags())" --no-graph --template "self.tags()"
$count=jj log --count -r "$tag..git_head()"
if ( $count -le 0 ){
return $tag
}
$hash=jj log -r "@-" --no-graph --template "commit_id.short(7)"
return "$tag-$count-g$hash"
}
jj-describe
# gist https://gist.github.com/hymkor/a80d59e7e99efa7a3b0cc10d929f51a7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment