1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-29 21:47:01 +02:00
Ivan Vandot 8877fe1ef4
feat: include prerelease suffix in git (#3841)
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

This commit will fix bad version tag sort if there is a prerelease on
the same commit as a release tag. Current output is shown below
```
❯ git tag --points-at HEAD --sort=-version:refname --format='%(creatordate)%09%(refname)'
Thu Mar 2 21:38:51 2023 +0300   refs/tags/v1.13.0-rc3
Thu Mar 2 21:38:51 2023 +0300   refs/tags/v1.13.0
```
Test is changed to match current default value so it will fail without
this fix.

Default value `-` is set to the one that is described inside
[docs](https://goreleaser.com/how-it-works/?h=prerelease#how-it-works),
but people are still allowed to change it.

Output with fix applied
```
❯ git -c versionsort.suffix=- tag --points-at HEAD --sort -version:refname --format='%(creatordate)%09%(refname)'
Thu Mar 2 21:38:51 2023 +0300   refs/tags/v1.13.0
Thu Mar 2 21:38:51 2023 +0300   refs/tags/v1.13.0-rc3
```

<!-- # Provide links to any relevant tickets, URLs or other resources
-->
More info about `versionsort.suffix` can be found
[here](https://github.com/git/git/blob/master/Documentation/config/versionsort.txt#L5)

Docs as well both schemas are updated as well.

I am not sure if users should be allowed to change this option at all.
2023-03-19 22:19:40 -03:00
..
2023-03-03 12:58:13 -03:00
2023-03-01 09:46:56 -03:00
2022-12-19 23:51:17 -03:00
2022-12-28 10:19:29 -03:00
2023-02-05 13:39:39 -03:00
2020-05-10 17:32:55 -03:00
2023-03-02 15:11:43 -03:00
2022-11-20 13:20:26 -03:00
2023-03-01 09:45:46 -03:00
2022-11-08 00:05:36 -03:00
2022-09-03 23:27:04 -03:00
2023-01-11 12:20:10 +00:00