diff --git a/statgit b/statgit index 975370d..d3e28c8 100755 --- a/statgit +++ b/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 "" 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