Skip to content

Instantly share code, notes, and snippets.

@infoburp
Forked from textarcana/git-log2json.sh
Created October 1, 2012 02:07
Show Gist options
  • Save infoburp/3809090 to your computer and use it in GitHub Desktop.
Save infoburp/3809090 to your computer and use it in GitHub Desktop.
git log JSON format > d3? HTML5GOURCE?
[alias]
log-json = log --pretty=format:'\"%h\": {%n \"commit\": \"%H\",%n \"author\": \"%an <%ae>\",%n \"date\": \"%ad\",%n \"message\": \"%s\"%n}'
# Use this one-liner to produce a JavaScript object literal from the output of the JSON log format:
git log-json -n5 | perl -pe 'BEGIN{print "var git_log = {"}; s/}/},/; END{print "};\n"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment