Last active
February 4, 2026 09:39
-
-
Save hymkor/a80d59e7e99efa7a3b0cc10d929f51a7 to your computer and use it in GitHub Desktop.
`git describe --tags` と同じようなことを jj でやる PowerShell Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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