devstefancho
devstefancho

Reputation: 2930

Github latest release is not same as a newest release

enter image description here

This is the situation.

  1. 30 minutes ago, I made a release note with tag name v4.2.4
  2. then, just now I make a new release note with tag name 2022-07-18-0013 (this tag name is just about date, my company sometime use this style version)

As far as I know latest release meaning that the newest release note, But In my case only semantic version(v4.2.4) can have latest tag.

why this is happened? I can not find any rules about only semantic version has privilege to get a latest.

(I want to know why this is happened, because I use latest release Github API)

------------- EDIT ----------------

git log --oneline print result below

0bc82b8 Merge pull request #166 from devstefancho/feature/0718_test1
2e85d9a add
6cc313e add
4c7e5b2 Merge pull request #165 from devstefancho/feature/0717_test2
f018fca test
b403615 Merge pull request #163 from devstefancho/feature/0717_test2
e7dd66f test

git log --graph --oneline

*   0bc82b8 Merge pull request #166 from devstefancho/feature/0718_test1
|\  
| * 2e85d9a add
|/  
* 6cc313e add
*   4c7e5b2 Merge pull request #165 from devstefancho/feature/0717_test2
|\  
| * f018fca test
* | b403615 Merge pull request #163 from devstefancho/feature/0717_test2
|\| 
| * e7dd66f test
|/  

------------------- Solved --------------------

Thanks for the great answer, finally figure out!

Reason : same day timestamp

If tags are not created in a same day, then the newest(by time) tag will be latest tag

enter image description here

Upvotes: 4

Views: 1445

Answers (1)

jsejcksn
jsejcksn

Reputation: 33901

This information was provided by a GitHub staff member:

Releases are based on Git tags, which mark a specific point in your repository’s history. The sort order of tags is as follows:

  • Tags are sorted by the timestamp of the underlying commit that they point to
  • If those commits are created on the same day, then the sorting is based on Semantic Versioning of the name of the tag (https://semver.org/)
  • If the Semantic Versioning is the same, they are sorted by second of creation

Pre-release versions have a lower precedence than the associated normal version.

Upvotes: 6

Related Questions