Created
July 16, 2013 00:20
-
-
Save jobwat/6004736 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dir.chdir "/home/vagrant/app" | |
logs = `git log --pretty 1.2.0..1.2.1 | grep -E "(T ?M[-_ ]?[0-9]+|T ?T[-_ ]?[0-9]+)"` | |
labels = logs.each_line.map do |line| | |
line.scan(/T ?[TM][-_ ]?[0-9]+/i).map do |s| | |
s.upcase.gsub(/T ?([TM])[^\d]?(\d+)/, 'T\1-\2') | |
end | |
end | |
final_list = labels.sort.uniq{|s|s.first} | |
final_list.each do |item| | |
puts item.inspect | |
end | |
# # get last tag version | |
# | |
# git describe --abbrev=0 --tags | |
# | |
# # http://stackoverflow.com/questions/1404796/how-to-get-the-latest-tag-name-in-current-branch-in-git | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment