Closed ryanwalls closed 9 years ago
The tags sorted in order, how they appear in your git repo. Are you sure, that 0.1.65 is older than 0.1.57?
please check it by command:
git log --tags --simplify-by-decoration --pretty="format:%ai %d"
I would expect the tags to sort in reverse order (newest tag first) just like it does on the releases page.
Ok. It should be in that order. Ok, I will check it!
@ryanwalls Hi. I check sorting method, and also add some tests for it, but can't reproduce your bug. All tags sorted according date from the commits, that assigned to tags. Have no idea, why it messed up in your case. It will be nice if you can reproduce it on some public repo or add more details about your case.
@skywinder Thanks for checking. I'll try to see if I can recreate in a public repo. But it's probably not a critical bug. Seems to only happen with tags on the same day. Most of the time, my tags will be on different days anyway.
@ryanwalls that's strange. The time from github api looks like "2015-03-04T17:10:16Z"
And it's stored and sorted as Time
class, parsed from string:
https://github.com/skywinder/github-changelog-generator/blob/master/lib/github_changelog_generator/fetcher.rb#L200
So, it doesn't matter is tag created one second or one day later.
Let's investigate this problem. As soon as I can reproduce it - I will fix it.
@ryanwalls any updates with this behaviour? Still try to reproduce it, but have no luck.
@ryanwalls Since there is only one time that this bug occurs and there is no way to reproduce it, I close it. Let me know, if you find any additional info.
We reproduced this in one of our Infospace private repos:
https://github.com/infospace/search_clientside_results/releases
Expect the 3.9.1.508 release tag to be most recent (by publish time and tag version) instead of the 3.9.0.507 one.
@sbrownInfospace your link doesn't work, since repo is private. I would like to debug this bug, but need real example.
Hi, I'm also experiencing this issue when using the API to create tags via the releases API calls.
any news on this?, its now 2017 and the github api still sorts tags incorrectly, or at least it looks like it sorts based on numeric value of the tag rather than the more logical sorting of when created.
Good evening! I am also experiencing inconsistent order from releases tagged in the same day: https://github.com/nuno-agostinho/psichomics/releases
EDIT: I fixed this by editing the tag from the version number alone to alphanumeric (e.g. changing some tags from 1.1.10
to v1.1.10
).
Reproducible issue on https://github.com/piwik/piwik-dotnet-tracker
We use this configuration file.
Here is the produced markdown. It would be nice to have 1.9.2 before 1.9.1, especially since the changelog links are not correct :
Here is the result of git log --tags --simplify-by-decoration --pretty="format:%ai %d"
:
This is the first time I have an issue with this tool. I am using it on several projects and it has saved me a lot of time managing changelogs.
It was working a couple of weeks ago on darwin. The results I am reporting here are on WSL, v1.14.3, Ruby 2.4.0p0
Getting the same error when creating a release for an Electron project using electron-builder
. Unfortunately this a private repo and I can't share it, but its created using the github API.
I am getting similar issues here:
https://github.com/nlmixrdevelopment/nlmixr/releases
It is a public repo; I tried adding/editing tags but it just cluttered it further.
This issue is still present today...
I have the same issue. Here is a screenshot. v1.1.0 should be above v1.0.0.
Hi everyone! I think I have some kind of solution. At least I've managed to order tags/releases at will.
There are two things to keep in mind:
GIT_TAGGER_DATE
to determine order in the releases/tags console. Not GIT_AUTHOR_DATE
nor GIT_COMMITTER_DATE
..patch
to the url) you'll see that any date within it will also have timezone information. I'm still not sure how GitHub handles this for viewers from different timezones or if it does some kind of truncation, but it is interesting to note that this issue is always happening for tags/releases having a date/time from the same day or at least with little time distance between each other. I also remember having this issue when tagging/releasing between 00:00 and 02:00 (casually I live in +02:00 timezone).With that being said, my solution was to use the following bash command (inspired from comments of this StackOverflow answer) to change tags dates as needed:
git tag -l | while read -r tag ; do COMMIT_HASH=$(git rev-list -1 $tag) && NEW_DATE=$(git show $COMMIT_HASH --format=%aD | head -1) && GIT_AUTHOR_DATE="$NEW_DATE" GIT_COMMITTER_DATE="$NEW_DATE" GIT_TAGGER_DATE="$NEW_DATE" git tag -a -f $tag -m"$tag" $COMMIT_HASH ; done && git push --tags --force
This will loop through all the tags and set GIT_TAGGER_DATE
, GIT_AUTHOR_DATE
and GIT_COMMITTER_DATE
equal to the original tag Author Date. Then it will force update upstream tags.
If you want to filter tags for this operations, use git tag -l \<pattern>.
If you want to use a custom date, change NEW_DATE
variable accordingly. Use Thu, 23 Apr 2020 01:38:28 +0200
like format.
You might have to try some different dates/times combinations to get the desired order.
@ernestostifano Just tried your command after hitting this issue myself, and it worked beautifully. Thanks!
The fix from @ernestostifano worked great for me, although I found the explanation to be partially inaccurate, in particular this part:
It seems GitHub uses GIT_TAGGER_DATE to determine order in the releases/tags console. Not GIT_AUTHOR_DATE nor GIT_COMMITTER_DATE.
At least in my case, GitHub was sorting my tags by creator date:
$ git tag -l --sort=-creatordate --format='%(creatordate:short): %(refname:short)'
2021-06-18: v0.6
2021-06-14: v0.6.1
2019-08-19: v0.5.3
2019-08-14: v0.5.2
I had created v0.6
myself using git tag
, whereas the other tags I'd created on the GitHub site.
For comparison, here are the tags sorted by tagger date, which looks correct:
$ git tag -l --format='%(refname) %(taggerdate)'
refs/tags/v0.5.2
refs/tags/v0.5.3
refs/tags/v0.6 Fri Jun 18 14:48:01 2021 -0400
refs/tags/v0.6.1
After running the command provided by @ernestostifano, the tags are now sorted properly by creator date:
$ git tag -l --sort=-creatordate --format='%(creatordate:short): %(refname:short)'
2021-06-14: v0.6.1
2021-06-11: v0.6
2019-08-19: v0.5.3
2019-08-14: v0.5.2
And after doing the git push --force --tags
, they're properly sorted in GitHub as well.
Thanks!
I'm unable to fix this with the script provided by @ernestostifano, and honestly it's somewhat ridiculous that this is still a thing at all. Private repo as well unfortunately, but the below screenshot shows the hilarity of the situation.
FWIW, we are seeing the same:
https://github.com/rdkcentral/firebolt-core-sdk/tags
the tag for v0.11.0-next.1
was created after v0.11.0-one-repository.1
through v0.11.0-one-repository.10
but it shows up after them in the list (currently on page two).
We definitely had a few minutes where we thought our CI was failing to tag the release, but then I saw the tag (sorted correctly) in my GitHub Desktop client, and went looking for it.
If I create multiple tags on the same day, in the changelog the tags are sorted in ascending order. I would expect them to sort in descending order.
Here's what is generated currently (this is a private repo, but you get the idea):