Commit 3d2b5b5
committed
Sort git tags when determining prerelease version
Tags are sorted lexicographically by default, not by version,
so for example right now `git ls-remote` for this repo shows:
```
$ git ls-remote --tags \
https://github.com/github/copilot-cli \
| tail -3 | awk -F/ '{print$NF}'
v1.0.8
v1.0.8-0
v1.0.9
```
With the sort option, it shows the correct latest prerelease tags:
```
$ git ls-remote --tags --sort "version:refname" \
https://github.com/github/copilot-cli \
| tail -3 | awk -F/ '{print$NF}'
v1.0.12-0
v1.0.12-1
v1.0.12-2
```
This option for git ls-remote was added in git version 2.18.0 in June 2018:
https://github.com/git/git/blob/v2.18.0/Documentation/RelNotes/2.18.0.txt#L69-L701 parent 2a03ddf commit 3d2b5b5
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
0 commit comments