Created
June 6, 2022 15:08
-
-
Save pellepim/d9ec59b854e77c70fb2663d361a67e01 to your computer and use it in GitHub Desktop.
Pretty print author's git log to JSON
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
git log --author="AUTHOR"\ | |
--pretty=format:'{"commit": "%H", "author": "%aN <%aE>", "date": "%ai", "message": """%B""", "notes": """%N""" },' \ | |
$@ | awk 'BEGIN { print("[") } { print($0) } END { print("]") }' | \ | |
python -u -c 'import ast,json,sys; fp = open("gitlog.json", "w"); \ | |
fp.write(json.dumps(ast.literal_eval(sys.stdin.read()), indent=2, sort_keys=True)); fp.close()' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gets a pretty printed JSON file containing info about a certain author's commits (all of them) in a repo.
Adapted from https://gist.github.com/cekstam/a7758b8f315835d479f379715eebd0c3