diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/index.js b/index.js new file mode 100644 index 0000000..7eeff26 --- /dev/null +++ b/index.js @@ -0,0 +1,35 @@ +var nodegit = require('nodegit') +var path = require('path') + +nodegit.Repository.open(path.resolve(__dirname, './.git')) + .then(function(repo) { + return repo.getBranchCommit('prototype'); + }) + .then(function(first_commit) { + var history = first_commit.history(nodegit.Revwalk.SORT.Time); + + history.on("commit", function(commit) { + console.log("commit " + commit.sha()); + console.log("Author:", commit.author().name() + + " <" + commit.author().email() + ">"); + console.log("Date:", commit.date()); + console.log("\n " + commit.message()); + + commit.getTree() + .then(function (tree) { + var entries = tree.entries(); + + // look at diffs here -- as entries grows and does not specify the *specific* entries of this commit + + for(e in entries) { + console.log(entries[e].path()); + } + + }); + + }); + + history.start(); + + }) + .done(); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..7543b34 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "reckon", + "version": "0.0.0", + "description": "Reckoning Histories of Computation", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/gauthiier/reckon.git" + }, + "keywords": [ + "Arcades", + "Project" + ], + "author": "gauthiier", + "license": "ISC", + "bugs": { + "url": "https://github.com/gauthiier/reckon/issues" + }, + "homepage": "https://github.com/gauthiier/reckon", + "dependencies": { + "nodegit": "^0.4.0" + } +}