Last active
December 16, 2015 09:49
-
-
Save nexeck/5416011 to your computer and use it in GitHub Desktop.
Generate valid JSON from git log
This file contains 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
#!/bin/sh | |
git log --pretty=format:'"%h":{"commit": "%H", "authorDate": "%ad", "authorDateTime": "%ai", "authorName": "%an", "subject": "%s"}' --date=short | sed 's/\\/\\\\/g' | gawk 'match($0, /(.*"subject": ")(.*)("})/, ary) {printf "%s%s%s\n", ary[1], gensub("\"","~","g",ary[2]), ary[3]}' | sed -e '1s/^/{/g;s/$/,/g;$s/,$/}/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment