Skip to content

Instantly share code, notes, and snippets.

@jobwat
Created July 16, 2013 00:20
Show Gist options
  • Save jobwat/6004736 to your computer and use it in GitHub Desktop.
Save jobwat/6004736 to your computer and use it in GitHub Desktop.
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