Permalink
Browse files

Sort tags by date.

  • Loading branch information...
1 parent fcfecc4 commit c48e24078e576acdc43a7127a8cf088389aea3a9 Nickolas Means committed May 25, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 gitflow-common
View
@@ -75,6 +75,8 @@ git_remote_branches() { git branch -r --no-color | sed 's/^[* ] //'; }
git_all_branches() { ( git branch --no-color; git branch -r --no-color) | sed 's/^[* ] //'; }
git_all_tags() { git tag; }
+git_all_tags_by_date() { git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags; }
+
git_current_branch() {
git branch --no-color | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g'
}
@@ -319,7 +321,7 @@ require_branches_equal() {
#
git_current_version() {
- echo "$(git_all_tags)" | grep -e '.*[0-9]*\.[0-9]*\.[0-9].*' | sed '$!d' | sed -n 's/[^0-9]*\([0-9]*.[0-9]*.[0-9]\)/\1/p'
+ echo "$(git_all_tags_by_date)" | grep -e '.*[0-9]*\.[0-9]*\.[0-9].*' | sed '$!d' | sed -n 's/[^0-9]*\([0-9]*.[0-9]*.[0-9]\)/\1/p'
}
git_current_major_version() {

0 comments on commit c48e240

Please sign in to comment.