-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Sort branches and tags by date descending #21136
Sort branches and tags by date descending #21136
Conversation
This doesn't raise the minimum git version (currently 2.0.0), right? |
According to the linked stackoverflow, it would raise it to |
No, it doesn’t. The “for-each-ref” command was available in 2.0.0: https://github.com/git/git/blob/v2.0.0/Documentation/git-for-each-ref.txt
The linked stackoverflow mentions 2.7.0 in context that sorting became available for “git branch” command. |
Yep, I misread that. |
|
if arg != "" { | ||
args = append(args, arg) | ||
args = append(args, strings.Fields(arg)...) |
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.
Splitting arguments by space is dangerous.
* upstream/main: Display image digest for container packages (go-gitea#21170) Use correct branch for .editorconfig error (go-gitea#21152) Passing command line arguments correctly by string slice (go-gitea#21168) Sort branches and tags by date descending (go-gitea#21136) Skip dirty check for team forms (go-gitea#21154) Add KaTeX rendering to Markdown. (go-gitea#20571)
Can someone please show how to turn this feature on in the Gitea UI? Is there a configuration line that needs to be added? |
@iranvir if you dont use current dev version it's not released |
This PR fixes #5709 and #17316 by changing the order of listed branches and tags to show the ones with latest commits atop.
It's achieved with changing underlying "show-ref" git command with "for-each-ref" as suggested in https://stackoverflow.com/a/5188364
Also, it's passing format string so the output matches "show-ref" command output.
close #5709
close #17316