[misc] add mvp suggestion to changelog task
This commit is contained in:
parent
b9aa00d970
commit
026a02c53c
12
Rakefile
12
Rakefile
|
@ -173,9 +173,11 @@ task :changelog do
|
||||||
last_sha = `cat changelog.txt | head -1`.split(' ').last
|
last_sha = `cat changelog.txt | head -1`.split(' ').last
|
||||||
shortlog = `git shortlog #{last_sha}..HEAD`
|
shortlog = `git shortlog #{last_sha}..HEAD`
|
||||||
changes = {}
|
changes = {}
|
||||||
|
committers = {}
|
||||||
for line in shortlog.split("\n")
|
for line in shortlog.split("\n")
|
||||||
if line =~ /^\S/
|
if line =~ /^\S/
|
||||||
committer = line.split(' (', 2).first
|
committer = line.split(' (', 2).first
|
||||||
|
committers[committer] = 0
|
||||||
elsif line =~ /^\s*((Merge.*)|(Release.*))?$/
|
elsif line =~ /^\s*((Merge.*)|(Release.*))?$/
|
||||||
# skip empty lines, Merge and Release commits
|
# skip empty lines, Merge and Release commits
|
||||||
else
|
else
|
||||||
|
@ -186,9 +188,19 @@ task :changelog do
|
||||||
tag = $1 || 'misc'
|
tag = $1 || 'misc'
|
||||||
changes[tag] ||= []
|
changes[tag] ||= []
|
||||||
changes[tag] << (line << ' thanks ' << committer)
|
changes[tag] << (line << ' thanks ' << committer)
|
||||||
|
committers[committer] += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for committer, commits in committers.to_a.sort {|x,y| y[1] <=> x[1]}
|
||||||
|
if ['Aaron Suggs', 'geemus', 'Wesley Beary'].include?(committer)
|
||||||
|
next
|
||||||
|
end
|
||||||
|
changelog << "MVP! #{committer}"
|
||||||
|
changelog << ''
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
for tag in changes.keys.sort
|
for tag in changes.keys.sort
|
||||||
changelog << ('[' << tag << ']')
|
changelog << ('[' << tag << ']')
|
||||||
for commit in changes[tag]
|
for commit in changes[tag]
|
||||||
|
|
Loading…
Reference in New Issue