-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tags sort by creation time (descending) on branch/tag dropdowns #23491
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #23491 +/- ##
==========================================
- Coverage 47.14% 47.13% -0.01%
==========================================
Files 1149 1154 +5
Lines 151446 152186 +740
==========================================
+ Hits 71397 71736 +339
- Misses 71611 71983 +372
- Partials 8438 8467 +29
... and 12 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I think it should be mentioned in the description that "Git supports two types of tags: lightweight and annotated, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -660,20 +660,9 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) { | |||
return | |||
} | |||
|
|||
tags, err := ctx.Repo.GitRepo.GetTags(0, 0) | |||
tags, err := repo_model.GetTagNamesByRepoID(ctx, ctx.Repo.Repository.ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
models
inside modules
.
HasSha1: util.OptionalBoolTrue, | ||
} | ||
|
||
tags := make([]string, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tags := make([]string, 0) | |
tags := make([]string) |
🎺 🤖 |
Agh sorry @delvh I guess my page never updated with your comments, missed it 🙁 |
* giteaofficial/main: Use `<nav>` instead of `<div>` in the global navbar (go-gitea#23125) Fix aria.js bugs: incorrect role element problem, mobile focus problem, tippy problem (go-gitea#23450) [skip ci] Updated translations via Crowdin Make time tooltips interactive (go-gitea#23526) Update mini-css-extract-plugin, remove postcss (go-gitea#23520) Fix review comment context menu clipped bug (go-gitea#23523) Add absent repounits to create/edit repo API (go-gitea#23500) Fix tags sort by creation time (descending) on branch/tag dropdowns (go-gitea#23491) Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (go-gitea#23463) Handle files starting with colons in WalkGitLog (go-gitea#22935) Change `Close` to either `Close issue` or `Close pull request` (go-gitea#23506) Update act (go-gitea#23512) Move pidfile creation from setting to web cmd package (go-gitea#23285)
This PR fixes the tags sort issue mentioned in #23432
The tags on dropdown shoud be sorted in descending order of time but are not. Because when getting tags, it execeutes
git tag sort --sort=-taggerdate
. Git supports two types of tags: lightweight and annotated, andgit tag sort --sort=-taggerdate
dosen't work with lightweight tags, which will not give correct result. This PR addGetTagNamesByRepoID
to get tags from the database so the tags are sorted.Also adapt this change to the droplist when comparing branches.
Dropdown places: