mirror of
https://github.com/hoxu/gitstats.git
synced 2026-03-01 18:23:26 +01:00
Workaround for linux-2.6.
This commit is contained in:
10
statgit
10
statgit
@@ -85,9 +85,15 @@ class GitDataCollector(DataCollector):
|
||||
# TODO also collect statistics for "last 30 days"/"last 12 months"
|
||||
lines = getoutput('git-rev-list --pretty=format:"%at %an" HEAD |grep -v ^commit').split('\n')
|
||||
for line in lines:
|
||||
# linux-2.6 says "<unknown>" for one line O_o
|
||||
parts = line.split(' ')
|
||||
stamp = int(parts[0])
|
||||
author = ' '.join(parts[1:])
|
||||
author = ''
|
||||
try:
|
||||
stamp = int(parts[0])
|
||||
except ValueError:
|
||||
stamp = 0
|
||||
if len(parts) > 1:
|
||||
author = ' '.join(parts[1:])
|
||||
date = datetime.datetime.fromtimestamp(float(stamp))
|
||||
|
||||
# First and last commit stamp
|
||||
|
||||
Reference in New Issue
Block a user