|
|
@@ -208,6 +208,7 @@ class GitDataCollector(DataCollector):
|
|
208
|
208
|
else:
|
|
209
|
209
|
self.commits_by_year[yy] = 1
|
|
210
|
210
|
|
|
|
211
|
+ # TODO Optimize this, it's the worst bottleneck
|
|
211
|
212
|
# outputs "<stamp> <files>" for each revision
|
|
212
|
213
|
self.files_by_stamp = {} # stamp -> files
|
|
213
|
214
|
lines = getoutput('git-rev-list --pretty=format:"%at %H" HEAD |grep -v ^commit |while read line; do set $line; echo "$1 $(git-ls-tree -r "$2" |wc -l)"; done').split('\n')
|
|
|
@@ -216,7 +217,10 @@ class GitDataCollector(DataCollector):
|
|
216
|
217
|
if len(parts) != 2:
|
|
217
|
218
|
continue
|
|
218
|
219
|
(stamp, files) = parts[0:2]
|
|
219
|
|
- self.files_by_stamp[int(stamp)] = int(files)
|
|
|
220
|
+ try:
|
|
|
221
|
+ self.files_by_stamp[int(stamp)] = int(files)
|
|
|
222
|
+ except ValueError:
|
|
|
223
|
+ print 'Warning: failed to parse line "%s"' % line
|
|
220
|
224
|
|
|
221
|
225
|
# extensions
|
|
222
|
226
|
self.extensions = {} # extension -> files, lines
|