Created
April 16, 2013 17:10
-
-
Save ryansb/5397662 to your computer and use it in GitHub Desktop.
Generates JSON blob for each commit in the master branch containing the author's name and the files they edited in that commit. I feel slightly bad for generating JSON with `echo` and `sed`.
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
#!/bin/bash | |
set -e | |
echo $(echo -n [ | |
for csha in $(git rev-list master) | |
do | |
echo -n " | |
{\"author\": \"`git log --pretty=format:'%an <%ae>' -n1 $csha`\", | |
\"files\": [`for i in $(git ls-tree --name-only -r $csha); do echo -n \\\"$i\\\", ; done`] | |
}," | |
done | |
echo -n ]) | sed -e 's/,]/]/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment