Permalink
Browse files

mark: changes in files

  • Loading branch information...
mneedham committed Sep 3, 2011
1 parent 75d544a commit 73d95232ff601c9e5e07b281acd4198e9273e54b
Showing with 34 additions and 4 deletions.
  1. +1 −1 README
  2. +19 −0 dashboard.js
  3. +13 −3 static/commitsGraph.js
  4. +1 −0 views/index.jade
View
2 README
@@ -66,4 +66,4 @@ Ideas to implement
[] Show the graph for individual files as well as for the whole code base
[] Make it possible to search for the files that can be graphed
-// git log --stat | ack "(src|\.\.\.)" | cut -d"|" -f1 | sort | uniq -c | sort -n | less
+// git log --no-merges --pretty="format:%s" --name-only | ack "^src" | sort | uniq -c | sort -n
View
@@ -250,6 +250,25 @@ app.get('/git/commits/by-day', function(req, res) {
});
});
+app.get('/git/most-changed-files', function(req, res) {
+ Step(
+ log("Resetting repository", function getRepositoryUpToDate() { exec('cd ' + config.git.repository + ' && git reset HEAD', this); }),
+ log("Parsing commits", function getGitEntries() { exec('cd ' + config.git.repository + ' && git log --no-merges --pretty="format:%s" --name-only | ack -v "tools" | ack -vi "mathjax" | ack "^src" | sort | uniq -c | sort -n | less', this) }),
+ function handleResponse(blank, gitEntries) {
+ var commits = [];
+ gitEntries.split('\n').forEach(function(item) {
+ var split = item.trim().split(" ");
+ if(item != "") commits.push({file : split[1], times : split[0]});
+ });
+
+ res.contentType('application/json');
+ res.send(JSON.stringify(commits));
+
+ }
+ );
+
+});
+
function parseCommitsFromRepository(fn) {
Step(
log("Resetting repository", function getRepositoryUpToDate() { exec('cd ' + config.git.repository + ' && git reset HEAD', this); }),
View
@@ -24,7 +24,6 @@ var CommitsGraphs = function() {
$("#commits-by-day").html("");
$("#commits-by-time").html("");
-
$.getJSON('/git/commits/by-time', function(data) {
var failedBuilds = [0,0,0,0,0,0,0,0,1,3,6,21,15,4,15,8,37,27,11,13,0,0,0,0];
@@ -54,10 +53,21 @@ var CommitsGraphs = function() {
}
});
});
-
+
+ $.getJSON('/git/most-changed-files', function(data) {
+ var commits = _(data).map(function(obj) { return obj.times; });
+ $.jqplot('most-changed-files', [commits], {
+ seriesDefaults: { showMarker:false, lineWidth: 1}, highlighter: { show: true, sizeAdjust: 7.5, showMarker: false },
+ axes : {
+ yaxis : { padMin : 0, pad: 1.1, min:0, max:127, tickOptions:{ formatString:'%.0f' } },
+ xaxis : { padMin : 0, renderer: $.jqplot.CategoryAxisRenderer }
+ }
+ });
+ });
+
$.getJSON('/git/commits/by-day', function(data) {
var commits = _(data).map(function(numberOfCommits) { return numberOfCommits; });
- var ticks = _(data).map(function(_, day) { return day; })
+ var ticks = _(data).map(function(_, day) { return day; });
drawGraph('commits-by-day', commits, ticks);
});
}
View
@@ -82,3 +82,4 @@ div(align="center")
div(id="go", style="height:800px;width:1200px;")
div(id="commits-by-time", style="height:800px;width:1200px;")
div(id="commits-by-day", style="height:800px;width:1200px;")
+ div(id="most-changed-files", style="height:800px;width:1200px;")

0 comments on commit 73d9523

Please sign in to comment.