Skip to content

Instantly share code, notes, and snippets.

@jmarmolejos
Created June 22, 2016 07:36
Show Gist options
  • Select an option

  • Save jmarmolejos/2b21a128655c969b1db4a137d13800d4 to your computer and use it in GitHub Desktop.

Select an option

Save jmarmolejos/2b21a128655c969b1db4a137d13800d4 to your computer and use it in GitHub Desktop.
// Some stuff I started prototyping at work but then had to switch to more 'important' things
var child_process = require('child_process');
child_process.exec('git log --decorate --oneline --stat=99999', (err, stdout, stderr) => {
var masterLineStart = "origin/master, origin/HEAD, master";
var lines = stdout.split("\n");
var lineAtMasterIndex = lines.findIndex(function(line){
return line.indexOf(masterLineStart) >= 0
})
console.log(lines[lineAtMasterIndex])
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment