|
|
@@ -96,6 +96,8 @@ class GitDataCollector(DataCollector):
|
|
96
|
96
|
self.author_of_month = {} # month -> author -> commits
|
|
97
|
97
|
self.author_of_year = {} # year -> author -> commits
|
|
98
|
98
|
self.commits_by_month = {} # month -> commits
|
|
|
99
|
+ self.first_commit_stamp = 0
|
|
|
100
|
+ self.last_commit_stamp = 0
|
|
99
|
101
|
|
|
100
|
102
|
lines = getoutput('git-rev-list --pretty=format:"%at %an" HEAD |grep -v ^commit').split('\n')
|
|
101
|
103
|
for line in lines:
|
|
|
@@ -103,6 +105,10 @@ class GitDataCollector(DataCollector):
|
|
103
|
105
|
stamp = int(parts[0])
|
|
104
|
106
|
author = ' '.join(parts[1:])
|
|
105
|
107
|
|
|
|
108
|
+ if self.last_commit_stamp == 0:
|
|
|
109
|
+ self.last_commit_stamp = stamp
|
|
|
110
|
+ self.first_commit_stamp = stamp
|
|
|
111
|
+
|
|
106
|
112
|
yymm = datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m')
|
|
107
|
113
|
if yymm in self.author_of_month:
|
|
108
|
114
|
if author in self.author_of_month[yymm]:
|
|
|
@@ -126,8 +132,6 @@ class GitDataCollector(DataCollector):
|
|
126
|
132
|
else:
|
|
127
|
133
|
self.author_of_year[yy] = {}
|
|
128
|
134
|
self.author_of_year[yy][author] = 1
|
|
129
|
|
-
|
|
130
|
|
- print self.author_of_month
|
|
131
|
135
|
|
|
132
|
136
|
def getActivityByDayOfWeek(self):
|
|
133
|
137
|
return self.activity_by_day_of_week
|
|
|
@@ -152,6 +156,12 @@ class GitDataCollector(DataCollector):
|
|
152
|
156
|
lines = getoutput('git-rev-list --all --pretty=format:%an |grep -v ^commit |sort |uniq')
|
|
153
|
157
|
return lines.split('\n')
|
|
154
|
158
|
|
|
|
159
|
+ def getFirstCommitDate(self):
|
|
|
160
|
+ return datetime.datetime.fromtimestamp(self.first_commit_stamp)
|
|
|
161
|
+
|
|
|
162
|
+ def getLastCommitDate(self):
|
|
|
163
|
+ return datetime.datetime.fromtimestamp(self.last_commit_stamp)
|
|
|
164
|
+
|
|
155
|
165
|
def getTags(self):
|
|
156
|
166
|
lines = getoutput('git-show-ref --tags |cut -d/ -f3')
|
|
157
|
167
|
return lines.split('\n')
|