Last active
October 20, 2019 07:56
-
-
Save jackyef/9996bf06fc7b59619b66e271f66b4c21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const child = require('child_process'); | |
const output = child.execSync(`git log --format=%B%H----DELIMITER----`).toString('utf-8'); | |
const commitsArray = output.split('----DELIMITER----\n').map(commit => { | |
const [message, sha] = commit.split('\n'); | |
return { sha, message }; | |
}).filter(commit => Boolean(commit.sha)); | |
console.log({ commitsArray }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment