Skip to content

Instantly share code, notes, and snippets.

@clojj
Created March 2, 2016 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clojj/aeda15e1b8cddf9c9309 to your computer and use it in GitHub Desktop.
Save clojj/aeda15e1b8cddf9c9309 to your computer and use it in GitHub Desktop.
nodegit session
var Git = require("nodegit");
var Rx = require("rx");
var repo = Git.Repository.open(".")
var mc = repo.then(function(repo){return repo.getMasterCommit()})
var history = mc.then(
function(masterCommit){
var hist = masterCommit.history();
Rx.Observable.fromEvent(hist, 'commit').subscribe(
function(commit){console.log(commit.messageRaw())},
function(err){},
function(){console.log('complete.')});
hist.start();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment