Hack the version_sorter gem to be able to sort_by. Because the gem only sorts strings at the moment we see ourselves having to first do a sort by tag names and then a map using find_tag, with each call going over the array again, which makes the whole process have a complexity of O(n * log n + n^2 / 2), if I'm correct.
Change gitlab_git to return refs (tags and branches) with their targets in the form of Gitlab::Git::Commits instead of strings. Right now, we ask Rugged for the references, which we then wrap around our Gitlab::Git::Ref object which ditches everything but the sha as a string. Back on gitlab-ce we find ourselves doing repository.commit(tag.target) for each tag, which goes back to the repository, when we could've preserved the reference.
Instead of hacking it, can be maybe submit a patch that allows this to be used starting a certain version? That should make things less of a pain to maintain.
Change gitlab_git to return refs (tags and branches) with their targets in the form of Gitlab::Git::Commits instead of strings. Right now, we ask Rugged for the references, which we then wrap around our Gitlab::Git::Ref object which ditches everything but the sha as a string.
Yes, it doesn't make sense to get all the info, throw all but the SHA away, then get that same info again.