Skip to content

Commit 55b5120

Browse files
committed
Deal with dates that fall off the end.
1 parent 40fd695 commit 55b5120

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tools/committer_count.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env ruby
22

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
44
# given period. It's of course, quite coarse -- someone with 10 commits in a day
55
# may or may not be more productive than someone with 3, but over long enough
66
# periods, it's an okay metric to measure involvement with the project, since
@@ -10,11 +10,11 @@
1010
# code review happened, so it's still a measure of work). You can get different
1111
# stats by ignoring merge commits, once option parsing is implemented.
1212
#
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
1818
#
1919
#
2020
# History with colors and e-mail addresses (respecting .mailmap):
@@ -49,9 +49,9 @@ def parse_date(date)
4949
date = ARGV[0] || "2005-03-22" # A day before the first SVN commit.
5050
calc_date = parse_date(date)
5151

52-
5352
@history.each_line do |line|
5453
parsed_line = line.match(/^([^\s+]+)\s(.{7,})\s'(.*)'\s(.*)[\r\n]*$/)
54+
next unless parsed_line
5555
break if calc_date == parsed_line[1]
5656
@recent_history << GitLogLine.new(*parsed_line[1,4])
5757
end

0 commit comments

Comments
 (0)