|
1 | 1 | #!/usr/bin/env ruby
|
2 | 2 |
|
3 |
| -# The commit_scorecard is a way to tell who's been active over the last |
| 3 | +# The committer_count.rb is a way to tell who's been active over the last |
4 | 4 | # given period. It's of course, quite coarse -- someone with 10 commits in a day
|
5 | 5 | # may or may not be more productive than someone with 3, but over long enough
|
6 | 6 | # periods, it's an okay metric to measure involvement with the project, since
|
|
10 | 10 | # code review happened, so it's still a measure of work). You can get different
|
11 | 11 | # stats by ignoring merge commits, once option parsing is implemented.
|
12 | 12 | #
|
13 |
| -# Usage: ./commit_scorecard.rb 2011-01-01 | head -10 # Since a particular date |
14 |
| -# ./commit_scorecard.rb 1y | head -10 # Last year |
15 |
| -# ./commit_scorecard.rb 6m | head -10 # Last six months |
16 |
| -# ./commit_scorecard.rb 12w | head -10 # Last twelve weeks |
17 |
| -# ./commit_scorecard.rb 100d | head -10 # Last hundred days |
| 13 | +# Usage: ./committer_count.rb 2011-01-01 | head -10 # Since a particular date |
| 14 | +# ./committer_count.rb 1y | head -10 # Last year |
| 15 | +# ./committer_count.rb 6m | head -10 # Last six months |
| 16 | +# ./committer_count.rb 12w | head -10 # Last twelve weeks |
| 17 | +# ./committer_count.rb 100d | head -10 # Last hundred days |
18 | 18 | #
|
19 | 19 | #
|
20 | 20 | # History with colors and e-mail addresses (respecting .mailmap):
|
@@ -49,9 +49,9 @@ def parse_date(date)
|
49 | 49 | date = ARGV[0] || "2005-03-22" # A day before the first SVN commit.
|
50 | 50 | calc_date = parse_date(date)
|
51 | 51 |
|
52 |
| - |
53 | 52 | @history.each_line do |line|
|
54 | 53 | parsed_line = line.match(/^([^\s+]+)\s(.{7,})\s'(.*)'\s(.*)[\r\n]*$/)
|
| 54 | + next unless parsed_line |
55 | 55 | break if calc_date == parsed_line[1]
|
56 | 56 | @recent_history << GitLogLine.new(*parsed_line[1,4])
|
57 | 57 | end
|
|
0 commit comments