From 026a02c53c5b640eb6f42b3b0628aabee26f4154 Mon Sep 17 00:00:00 2001 From: geemus Date: Thu, 26 May 2011 16:14:52 -0700 Subject: [PATCH] [misc] add mvp suggestion to changelog task --- Rakefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Rakefile b/Rakefile index 14adf2ae3..1632f4d7c 100644 --- a/Rakefile +++ b/Rakefile @@ -173,9 +173,11 @@ task :changelog do last_sha = `cat changelog.txt | head -1`.split(' ').last shortlog = `git shortlog #{last_sha}..HEAD` changes = {} + committers = {} for line in shortlog.split("\n") if line =~ /^\S/ committer = line.split(' (', 2).first + committers[committer] = 0 elsif line =~ /^\s*((Merge.*)|(Release.*))?$/ # skip empty lines, Merge and Release commits else @@ -186,9 +188,19 @@ task :changelog do tag = $1 || 'misc' changes[tag] ||= [] changes[tag] << (line << ' thanks ' << committer) + committers[committer] += 1 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 changelog << ('[' << tag << ']') for commit in changes[tag]